We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
In some cases, grn_io_win_map() is called many times and the cost of an integer division may affect the performance.
grn_io_win_map()
groonga/lib/io.c
Lines 989 to 993 in 9c8a355
if (offset >= segment_size) { segment += offset / segment_size; offset = offset % segment_size; } nseg = (offset + size + segment_size - 1) / segment_size;
segment_size is generally a power of two and divisions can be replaced with a bitwise-shift or bitwise-and.
segment_size
The text was updated successfully, but these errors were encountered:
I've compared a division based implementation and a bitwise-shift based implementation, but I could not find significant differences.
Sorry, something went wrong.
The attached files are the patches I tested.
Rejected!
s-yata
No branches or pull requests
Description
In some cases,
grn_io_win_map()
is called many times and the cost of an integer division may affect the performance.groonga/lib/io.c
Lines 989 to 993 in 9c8a355
Hint
segment_size
is generally a power of two and divisions can be replaced with a bitwise-shift or bitwise-and.The text was updated successfully, but these errors were encountered: