Skip to content

Eliminate the vptr from struct anode#61

Open
Quuxplusone wants to merge 2 commits intoTessil:masterfrom
Quuxplusone:eliminate-vptr
Open

Eliminate the vptr from struct anode#61
Quuxplusone wants to merge 2 commits intoTessil:masterfrom
Quuxplusone:eliminate-vptr

Conversation

@Quuxplusone
Copy link
Copy Markdown

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.

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 never erase from it and (4) I will never inspect or iterate its contents — so while I need its .size() and .contains() methods to work just like set's do, I specifically do not need my data structure to store materialized copies of all the strings it holds. I have the impression that htrie_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?

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.
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

Successfully merging this pull request may close these issues.

1 participant