okio icon indicating copy to clipboard operation
okio copied to clipboard

Switch to short for Segment’s `pos` and `limit` ?

Open swankjesse opened this issue 1 year ago • 0 comments

These values are guaranteed in [0..8192] so an int is overkill. Switching these two values to short shrinks Segment’s memory footprint from 40 to 32 bytes, according to JOL.

Are there adverse consequences to using shorts? These two fields are very busy in the inner-loop.

swankjesse avatar Oct 27 '22 20:10 swankjesse