Commit 1d28478
Optimize UINT64/UINT128 decoding to avoid BigInteger allocation
For UINT64/UINT128 values less than 8 bytes (which fit in long's positive
range), decode directly to long instead of BigInteger when the target is a
typed field. This avoids unnecessary BigInteger object allocation for common
cases like UINT64 values under 2^56.
Maintains backward compatibility by preserving BigInteger return type for
Object.class targets (e.g., Map decoding).
Performance impact:
- UINT64(500) into Long field: decodes as long (no BigInteger allocation)
- UINT64(500) into Object/Map: still returns BigInteger (backward compatible)
- UINT64 >= 8 bytes: always uses BigInteger (correctness)
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <[email protected]>1 parent c20e678 commit 1d28478
1 file changed
+7
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
244 | 244 | | |
245 | 245 | | |
246 | 246 | | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
247 | 254 | | |
248 | 255 | | |
249 | 256 | | |
| |||
0 commit comments