Eliminate the vptr from struct anode#61
Open
Quuxplusone wants to merge 2 commits intoTessil:masterfrom
Open
Conversation
No functional change.
I modified `tsl_hat_trie_tests` to count all its memory allocations (not footprint, just sum the size of every call to `operator new`), and observed a 1.5% reduction in memory allocations. That's not much, but it fixes a TODO comment.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
I modified
tsl_hat_trie_teststo count all its memory allocations (not footprint, just sum the size of every call tooperator new), and observed a 1.5% reduction in memory allocations. That's not much, but it fixes a TODO comment.FYI, for my purposes what I'm actually looking for is some data structure that's (1) a drop-in replacement for
set<string>and (2) very memory-efficient, but where my concessions are that (3) I will nevererasefrom it and (4) I will never inspect or iterate its contents — so while I need its.size()and.contains()methods to work just likeset's do, I specifically do not need my data structure to store materialized copies of all the strings it holds. I have the impression thathtrie_set<char>wastes a lot of memory (from my point of view) by storing materialized copies of all its strings; is this in fact the case, and if so, is there any easy way to "turn off" that feature?