Commit Graph
505 Commits
Author SHA1 Message Date
andrew d78b36821b Remove more redundant nullptr checks 2024-03-19 15:05:34 -07:00
andrew ce79b47fbe Revert 303b368fc5
This is a code-size / speed tradeoff. Maybe it's a good idea here, but
it's a bit weird to do this in some places and not others (there are
many places we can avoid switching on type this way). The compiler can
inline and then dead code eliminate to achieve the same effect, so we'll
just let the compiler be in charge of inlining decisions.
2024-03-19 15:01:13 -07:00
andrew 727b7e642a Save more redundant nullptr checks 2024-03-19 14:34:59 -07:00
andrew cb4c2b7e1e Avoid redundant null check in some cases 2024-03-19 14:29:13 -07:00
andrew 83c7f66d67 Remove some redundant nullptr checks 2024-03-18 16:22:24 -07:00
andrew a5710b8282 Remove performance-only code from debug build for increased coverage 2024-03-18 16:21:55 -07:00
andrew c31eebd5de No caller of CheckRangeRightSide::downLeftSpine has null n 2024-03-18 16:03:41 -07:00
andrew ddeb059968 Remove more dead code 2024-03-18 16:01:56 -07:00
andrew 5a0bcf9a5a Strengthen precondition to checkRangeStartsWith
and remove resulting dead code
2024-03-18 15:44:44 -07:00
andrew 97717cec86 Remove suspected dead code
Removing it is definitely safe. I suspect that any way to get here would
have already returned from checkRangeRead during the search for the
common prefix
2024-03-18 15:30:15 -07:00
andrew 6a13c43a78 Remove mistakenly checked in printfs 2024-03-18 14:03:09 -07:00
andrew c6c438bae2 Address more missing coverage
cc #3. Found some non-trivial dead code this time!
2024-03-18 14:01:30 -07:00
andrew 7d4f832b43 Address some missing coverage
cc #3
2024-03-18 13:36:35 -07:00
andrew 5b0c3c2428 Exclude more from coverage
Only count ConflictSet.cpp in jenkins now, and also add some more
excludes for unreachable lines
2024-03-18 12:05:52 -07:00
andrew 8e0e65dac6 Count implicit key byte for maybeDecreaseCapacity 2024-03-18 11:42:53 -07:00
andrew 2e246ec6a4 Cachegrind says this is fewer instructions 2024-03-16 08:46:41 -07:00
andrew 6d7e3c9849 Fix invalid offsetof warnings 2024-03-15 21:37:21 -07:00
andrew 303b368fc5 Add Type template parameter to maybeDownsize to avoid branch 2024-03-15 18:05:32 -07:00
andrew 9f5a68e2c0 Use plain loop for Node3 2024-03-15 17:35:14 -07:00
andrew dfbb3ce5f1 Use assume
It works now that we fell back to the __builtin_unreachable based
implementation for gcc.
2024-03-15 17:23:02 -07:00
andrew 83fedf1f9e Remove dead code 2024-03-15 17:00:20 -07:00
andrew 8556caf360 Cachegrind says memset uses fewer instructions here 2024-03-15 16:57:16 -07:00
andrew 9d13ca84f5 Fix bug spotted by hand. No test coverage there yet 2024-03-15 16:55:34 -07:00
andrew a79436ee9b Use statically-known numChildren in Node3 -> Node16 2024-03-15 16:52:40 -07:00
andrew e9c8537cf2 Copy Node members and set children pointers in copyChildrenAndKeyFrom 2024-03-15 16:28:58 -07:00
andrew 5b988efe6f Consolidate copyChildrenAndKeyFrom implementations 2024-03-15 16:12:44 -07:00
andrew e35d698b21 Improve copyChildrenAndKeyFrom-related codegen 2024-03-15 08:19:16 -07:00
andrew eb93157ddf Improve codegen in freeAndMakeCapacityAtLeast 2024-03-14 19:23:49 -07:00
andrew 429fe5baed Fix some uses of uninitialized memory
Introduced in ee36bda8f8, unsurprisingly.
2024-03-14 15:39:37 -07:00
andrew a0451e4423 Give radix tree setOldestVersion an extra 10 work per call
It seemed to really be important for the skip list. I'm cargo culting
this a little bit here.
2024-03-14 15:32:39 -07:00
andrew b817e3c749 Track malloc size with a header for SHOW_MEMORY 2024-03-14 15:30:46 -07:00
andrew ee36bda8f8 Track initializedness of Node memory more precisely
By not initializing Node members with dummy default values.

This has performance/code size benefits, and improves debugging when
running under valgrind.

Unfortunately this also makes it easy to write code that uses
uninitialized memory, so if valgrind doesn't have good coverage then we
might let some uninit usages sneak through.

We plan to have good coverage for valgrind, so I think it's ok. If
writing correct code becomes too tedious then we can go back to
initializing Node fields with dummy default values.
2024-03-14 14:58:20 -07:00
andrew 35086ee66a Add GCOVR_EXCL_LINE to default labels too 2024-03-13 20:54:05 -07:00
andrew 0f795cf163 Set -DNVALGRIND for release artifacts 2024-03-13 20:45:59 -07:00
andrew a07c93ffff New switch idiom
Add -Wswitch-enum -Werror=switch-enum to enforce that we explicitly
handle all cases, and add a default: __builtin_unreachable() to all
switches to make un-enumerated values UB
2024-03-13 20:07:27 -07:00
andrew c68f563017 "partial capacity bytes" -> "partial key capacity bytes" 2024-03-13 18:51:48 -07:00
andrew 6b6a9bace9 Fix SHOW_MEMORY for gcc and glibc on linux 2024-03-13 16:57:38 -07:00
andrew 3cb0765fdd Rework SHOW_MEMORY
closes #10
2024-03-13 16:48:28 -07:00
andrew 351ff3df3b Cave in and just add the unreachable's gcc wants 2024-03-13 14:58:34 -07:00
andrew e818648cdc makeCapacityAtLeast -> freeAndMakeCapacityAtLeast 2024-03-13 14:01:47 -07:00
andrew 12540b8713 maybeDecreaseCapacity policy was too strong
We can allow larger capacities and still pay for the key bytes
2024-03-13 14:00:01 -07:00
andrew a9caa0249e Use plain enum for type
My understanding is that this it's now UB for any value that's not
listed to inhabit Type, so the gcc warning about control reaching the
end of a function with an exhaustive switch where every case returns
should go away now.
2024-03-13 13:20:48 -07:00
andrew 08b2b7f41a Move comment to above field it's commenting on 2024-03-13 12:38:16 -07:00
andrew 26bd8b94cc Lower kBytesPerKey to 144 by changing Node4 to Node3 2024-03-13 12:29:01 -07:00
andrew 55eaef5b1d Remove 16 bytes from Node0 2024-03-13 10:59:25 -07:00
andrew 797e6b4a3e Use switch for type dispatch throughout 2024-03-13 10:59:19 -07:00
andrew ee86b5289b Rearrange induction inequalities
This looks nicer IMO
2024-03-13 07:31:24 -07:00
andrew b779c0f6f7 Fix induction (again). Now it's 176 bytes per key 2024-03-13 07:26:49 -07:00
andrew ef802b8acd Only skip free list from maybeDecreaseCapacity 2024-03-12 17:33:28 -07:00
andrew 5371c2bede Change kMinChildrenNode4 to 2, fixing the induction 2024-03-12 16:34:20 -07:00