Improve compile time and introduce features #2
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This patch allows the different indexes to be toggled since they contribute significantly to compile time and for many applications not all three are needed. Additionally, the entry-or_insert pattern was replaced by building the HashMap from a slice, reducing the compile time even more.
Behavioral Change: If the index contains multiple entries with the same key, the last one is used instead of the first one. This is because the entries are consumed from a vec, which causes duplicated keys to be overwritten, instead of skipping them. If this is considered as a blocker for this PR, reversing the list of records before generating the code should resolve that. Since this scenario wasn't included in the tests and reversing the list could mean extra effort, I left that out for now.