-
Notifications
You must be signed in to change notification settings - Fork 17
4.x perf optimizations #84
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: 4.X
Are you sure you want to change the base?
Conversation
Kevin-P-Kerr
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My only concern is that FixedIntegerList can only represent (I believe) 8 bit values. That works for this use case?
|
@Kevin-P-Kerr yes, the gpp state specs only represent values 0,1,2 as the values (e.g. SensitiveDataProcessing , KnownChildSensitiveDataConsents). theoretically it could have been packed even smaller, but i found byte the smallest primitive which has built-in casts to/from int. |
| public int setInt(int index, int value) { | ||
| // NOTE: int 128 is prevented since it would get turned into byte -128 | ||
| if(value < 0 || value >= 128) { | ||
| throw new IllegalArgumentException("FixedIntegerList only supports positive integers less than 128."); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should be fine as the most typical values are 0,1,2 I believe
i have tried the 4.X branch out in a real production environment under real load. this allowed me to profile and kill off more hotspots. here are the main changes:
FixedIntegerListinstead ofList<Integer>. that FixedIntegerList is much more optimized: store in a byte array, add methods for unboxed access.