Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use of std::vector, std::map/std::unordered_map #101

Open
lerno opened this issue Jan 29, 2019 · 2 comments
Open

Use of std::vector, std::map/std::unordered_map #101

lerno opened this issue Jan 29, 2019 · 2 comments

Comments

@lerno
Copy link
Collaborator

lerno commented Jan 29, 2019

This is related to #100 which usually occurs together with STL usage.

In my research std::unordered_map/std::map are not very efficient for the special cases we want to use them for. Consequently hash maps could be replaced by simpler replacements reducing compilation time and increasing efficiency.

@bvdberg
Copy link
Member

bvdberg commented Jan 31, 2019

do you have specific instances which you want to replace?

@lerno
Copy link
Collaborator Author

lerno commented Jan 31, 2019

@bvdberg Well, the glaring problem is in the parsing code, but creating a custom hash and vector could then be reused across the codebase I think. Note that llvm's implementations like smallvector (allocates the vector on the stack unless it grows large – ideal for when collecting a list of attributes etc that is known to be small in the common case) can probably be a good alternative to rolling ones own alternatives.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants