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

Possibly more efficient structure of variable set #150

Open
magicant opened this issue Apr 10, 2022 · 1 comment
Open

Possibly more efficient structure of variable set #150

magicant opened this issue Apr 10, 2022 · 1 comment
Projects

Comments

@magicant
Copy link
Owner

magicant commented Apr 10, 2022

Currently, VariableSet has a hash map to store variables where keys are variable name strings and values are vectors of pairs of a variable definition and context index. This structure requires vector allocation for each variable name.

It may be more efficient to use a tree map with keys being pairs of a variable name and context index and values being variable definitions.

TODO: Does this idea go well with the usage of Borrow for key comparison?

@magicant magicant added this to To do in Main via automation Apr 10, 2022
@magicant
Copy link
Owner Author

magicant commented Apr 11, 2022

Another idea is to store a variable name and value in a single C string of the form name=value (or name=comma:separated:array:values). This will reduce allocation in env_c_strings.

TODO: How do we handle unwanted null bytes in the middle of a string?

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

No branches or pull requests

1 participant