test(b+tree): make the absl::btree_set comparison buildable, and widen it - #161
Open
psiha wants to merge 1 commit into
Open
test(b+tree): make the absl::btree_set comparison buildable, and widen it#161psiha wants to merge 1 commit into
psiha wants to merge 1 commit into
Conversation
psiha
force-pushed
the
bt/7-devector-nodes
branch
from
September 9, 2026 10:34
944e568 to
a29ae00
Compare
psiha
force-pushed
the
bt/8-absl-bench
branch
from
September 9, 2026 10:34
d3c0245 to
2e348ea
Compare
psiha
force-pushed
the
bt/7-devector-nodes
branch
from
September 9, 2026 10:39
a29ae00 to
bc3ec57
Compare
psiha
force-pushed
the
bt/8-absl-bench
branch
from
September 9, 2026 10:39
2e348ea to
94287b3
Compare
psiha
force-pushed
the
bt/7-devector-nodes
branch
from
September 9, 2026 10:45
bc3ec57 to
74135fe
Compare
psiha
force-pushed
the
bt/8-absl-bench
branch
from
September 9, 2026 10:45
94287b3 to
d666112
Compare
psiha
force-pushed
the
bt/7-devector-nodes
branch
from
September 9, 2026 10:49
74135fe to
3b497a6
Compare
psiha
force-pushed
the
bt/8-absl-bench
branch
from
September 9, 2026 10:49
d666112 to
30ef9e8
Compare
psiha
force-pushed
the
bt/7-devector-nodes
branch
from
September 9, 2026 10:56
3b497a6 to
65ea48f
Compare
psiha
force-pushed
the
bt/8-absl-bench
branch
from
September 9, 2026 10:56
30ef9e8 to
3e25d5b
Compare
psiha
force-pushed
the
bt/7-devector-nodes
branch
from
September 9, 2026 11:13
65ea48f to
8c6f6d7
Compare
psiha
force-pushed
the
bt/8-absl-bench
branch
from
September 9, 2026 11:13
3e25d5b to
853465d
Compare
psiha
force-pushed
the
bt/7-devector-nodes
branch
from
September 9, 2026 11:35
8c6f6d7 to
1780d04
Compare
psiha
force-pushed
the
bt/8-absl-bench
branch
from
September 9, 2026 11:35
853465d to
fcbde9e
Compare
…n it The benchmark already had an absl arm behind `#define HAVE_ABSL 0`, with no way to turn it on. `-DPSI_VM_BENCH_ABSL=ON` now fetches abseil through CPM and defines it. absl::btree_set is the closest shipping container to this one - it also redistributes into a sibling before splitting - so it is the right thing to be measured against. One build detail worth recording: psi.build's MSVC toolchain defines __GNUC__ globally (clang-cl does support the GNU-style extensions), and abseil reads that as "GNU platform" and tries to build its libsupc++ demangler, which wants cxxabi.h. The definition is dropped for abseil's subtree only, by filtering the directory property before CPMAddPackage - a subdirectory inherits it as it stands at the add_subdirectory() call. The benchmark itself measured only sorted bulk insertion, which is every container's best case and is not the state a long-lived index is in. It now also measures one-by-one insertion in random order, and the footprint of both containers afterwards: psi::vm's from nodes_reserved(), absl's through a counting allocator, since absl exposes bytes_used() only on the internal btree. Footprint is what the occupancy work is about, so it belongs here.
psiha
force-pushed
the
bt/7-devector-nodes
branch
from
September 9, 2026 12:01
1780d04 to
2785abf
Compare
psiha
force-pushed
the
bt/8-absl-bench
branch
from
September 9, 2026 12:01
fcbde9e to
48b96d9
Compare
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.
The benchmark already had an
absl::btree_setarm behind#define HAVE_ABSL 0, with no way to turn it on.-DPSI_VM_BENCH_ABSL=ONnow fetches abseil through CPM and defines it.absl::btree_setis the closest shipping container to this one — it also redistributes into a sibling before splitting — so it is the right thing to be measured against.It also measures more than it did: sorted bulk insertion is every container's best case and is not the state a long-lived index is in, so there is now a one-by-one random insertion arm and a footprint column for both containers (
nodes_reserved()here; a counting allocator for absl, which exposesbytes_used()only on the internal btree).What it says
7.65M
int, one box, Release + LTO. abseil's default node is 256 bytes (/*TargetNodeSize=*/256), so the 4096 column is a 16× geometry mismatch and the 512 column a 2× one.At the default 512-byte geometry this container holds its own: parity on random insert and random lookup, 1.75× faster on sorted bulk insert, slightly smaller. The one loss is lookup on a freshly bulk-built — fully packed — tree.
At
PSI_VM_BT_PAGE_SIZED_NODESit does not: 1.5–1.8× slower on lookups and one-by-one inserts, and 2× slower than itself at 512 bytes on random insertion. The likely mechanism is cache lines touched per node: 256 B is 4 lines and 512 B is 8, against 64 for a 4096-byte node — fewer tree levels, far more lines per descent.⚠ Caveat worth stating rather than burying: with
int/std::less, 512 bytes falls underlinear_search_byte_limitand 4096 does not, so the two columns differ in node size and in intra-node search. Each is the right choice for its own geometry, so this is a fair end-to-end configuration comparison — but it is not an isolated node-size measurement.Build note
psi.build's MSVC toolchain appends
__GNUC__to the global compile definitions (clang-cl does support the GNU-style extensions), and abseil reads that as "GNU platform" and builds its libsupc++ demangler, which wantscxxabi.h. The definition is dropped for abseil's subtree only, by filtering the directory property beforeCPMAddPackage— a subdirectory inherits it as it stands at theadd_subdirectory()call.Stacked on #159.