-
Notifications
You must be signed in to change notification settings - Fork 634
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
modified freelist_hmap/hashmapGetFreePageIDs function with better performance #219
Conversation
for i := 0; i < int(size); i++ { | ||
m = append(m, start+pgid(i)) | ||
|
||
keys := make([]pgid, 0, len(f.forwardMap)) |
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.
keys := make([]pgid, 0, len(f.forwardMap)) | |
startPageIds := make([]pgid, 0, len(f.forwardMap)) |
size, ok := f.forwardMap[start] | ||
if ok { |
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.
size, ok := f.forwardMap[start] | |
if ok { | |
if size, ok := f.forwardMap[start]; ok { |
Added label |
Rebased the commits and sent as new PR #419 |
superseded by #419 |
Since forwardMap key is the start point, value is the length starting with the key, then we just sort the key to make the whole array sorted instead of sorting the whole array.
This is my performance test compared with these two algorithms:
based on the above testing program, when changing N, got the following result compared with two functions
ENV : 8 GB 2133 MHz LPDDR3 / 1.6 GHz 2 Cores Intel Core i5