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
Labels
breaking change This enhancement is backward-incompatible

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
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=colon: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?

@magicant magicant added the breaking change This enhancement is backward-incompatible label Jun 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking change This enhancement is backward-incompatible
Projects
Status: To do
Development

No branches or pull requests

1 participant