Commit ab6a6a0
committed
Resolve write performance regression (fixes #268)
Bisection using the LmdbJava Benchmarks project identified a 40%
write performance regression introduced in commit 68f0a44:
Commit Date Score Change Message
===============================================================================
be2a15b 2023-02-04 00:28:16 89.07 [maven-release-plugin] pr
1cc7e6c 2023-12-04 07:42:08 94.49 +6.09% Test on Java 21
f17b63f 2023-12-05 01:34:17 91.57 -3.09% [maven-release-plugin] pr
b5dfb25 2025-02-16 23:37:16 91.38 -0.21% Uplift lmdb from 0.9.29 t
* 68f0a44 2025-02-16 23:46:30 128.63 +40.76% Add DbiFlags#MDB_UNSIGNED
928cf7b 2025-02-20 01:26:13 129.12 +0.38% Add url element to pom.xm
dc24f4b 2025-10-31 00:20:59 122.03 -5.49% Generalise benchmark link
Root cause: MaskedFlag.mask() was changed from a simple for-loop to
Stream API in commit 68f0a44. This method is invoked once per write
operation (Cursor.put() line 255), causing significant overhead from
stream creation, lambda allocation, and boxing/unboxing.
Fix: Restore for-loop implementation while preserving the
onlyPropagatedToLmdb filtering logic added in 68f0a44.
Performance verified with 1M entry write benchmark:
- Before fix: 122.03 ms/op
- After fix: 90.43 ms/op (within 2% of baseline 89.07 ms/op)1 parent dc24f4b commit ab6a6a0
1 file changed
+14
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
75 | 75 | | |
76 | 76 | | |
77 | 77 | | |
78 | | - | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
79 | 92 | | |
80 | 93 | | |
81 | 94 | | |
| |||
0 commit comments