[PATCH] D27146: Merge strings using a probabilistic algorithm to reduce latency.

Sean Silva via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Nov 26 22:01:54 PST 2016


silvas added a comment.

This is a really neat idea! Great observation that the string deduplication doesn't have to be completely perfect.

One question: how much possible speedup is there from optimizing this code path, and how much of that does the current patch get?

My biggest concern with this approach is how to get deterministic output from this approach.

As it stands, the current patch is very similar to having StringTableBuilder only use `StringIndexMap.insert` some fraction of the time, and the rest of the time just using `find` and appending the string to the table if it isn't found.



================
Comment at: ELF/OutputSections.cpp:633
+            size_t Size = align2(S.size(), StringAlignment);
+            Piece.OutputOff = Offset.fetch_add(Size);
+          } else {
----------------
This will result in non-deterministic output :/


https://reviews.llvm.org/D27146





More information about the llvm-commits mailing list