-
Notifications
You must be signed in to change notification settings - Fork 2
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
Improve BitSet #3
Comments
Cool stuff, I'll implement that and see what the performance benefits are for me. Thanks!!!!! 😄 I'd like to give you some reasoning why I made certain decisions and have your thoughts on it:
I was wondering if you have any ideas on how to make this faster as well? This is still the latest fastest version: One thing I found really cool as well is the way I use generics now to ensure the |
1 (A bit slower it seems):
2 (A bit faster it seems):
|
The picture shows the new performance but what was the old result? how many % faster? On my local environment, I got 50% performance boost. Regarding things going a bit faster when not grouped. Normally it's a good practice to group the same of instructions but it's not the case here since JIT emits multiple different instructons to handle the conditions etc. So in the second case what I assume happens is that registers are beeing reused. Locals like: actuallyGoingLeft etc. Are beeing either pushed to registers or pushed to the stack but since they are a temp computation the register/stack can be reused. If you group them you will have many locals and you will most likeley run out of registers and the compiler will be forced to push and out of the stack. |
The next big one should be optimizing memory access for the bit array and the two dimensional map array. Another big one is SIMD instructions but they work the best if you can access your memory and load up the vectors as fast as possible. |
I just found the issue, apparently I had to change 1 to 1L to make them long's. |
Bit sets currently use 32bit words, this is not optimal since CPUs use 64-bit words and 64bit cache lines.
The text was updated successfully, but these errors were encountered: