Commit 4e7ab8e
Skip Hibernate deep copy for ValueEntity.data JSON column
Add @mutability(Immutability.class) to the JSONB data field so Hibernate
uses reference equality instead of deserialize-compare-reserialize for
dirty checking. All code paths that modify data use reference replacement
(data = newData), never in-place mutation, so reference equality is
correct.
Profiling showed deepCopy + dirty-checking of the JSON column consumed
~50% of CPU during uploads. This eliminates both entirely — deepCopy
drops to 0 samples, dirty-checking to near-zero. Wall-clock improvement
of ~17% on a 4-worker rhivos import (1m36s to 1m20s) with CPU user time
cut in half (2m02s to 59s).1 parent ce04c60 commit 4e7ab8e
1 file changed
Lines changed: 3 additions & 0 deletions
Lines changed: 3 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| 12 | + | |
12 | 13 | | |
| 14 | + | |
13 | 15 | | |
14 | 16 | | |
15 | 17 | | |
| |||
25 | 27 | | |
26 | 28 | | |
27 | 29 | | |
| 30 | + | |
28 | 31 | | |
29 | 32 | | |
30 | 33 | | |
| |||
0 commit comments