Commit 73834c9
authored
perf: Reduce allocations when writing database (#985)
In my profiling I found 2 things to take the most performance in our
application:
- the AES encryption
- Copies and allocations of Uint8Lists
Increasing the size of the initial buffer allocation to one page (4kB)
makes those allocations only show up marginally in my profiling. While
this is somewhat of a magic number, most systems use a page size of 4kB
or larger.
While this slightly increases the default memory usage when using hive,
I would expect most boxes to have more than 256 bytes of data (which
includes key and value). If any application actually uses many boxes of
less than 256 bytes, they could probably save more memory by using fewer
boxes and at the same time probably improve performance.
Signed-off-by: Nicolas Werner <[email protected]>1 parent 7faa095 commit 73834c9
1 file changed
+1
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | | - | |
| 14 | + | |
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| |||
0 commit comments