-
Notifications
You must be signed in to change notification settings - Fork 198
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
Optimisation computeDigest() in key.go? #1
Comments
Thank you for your suggestion. A simple singleton buffer cannot be used in concurrent applications. We can use a queue to cache many buffers, but then we will have to pay the cost of synchronization (and memory to keep all those buffers around indefinitely). I still agree that this part of code is a hot spot and should be further optimized, and a variation of your suggestion could potentially reduce the load on GC. Please note that the client code is not micro-optimized yet. We'll begin to work on optimizations and micro-benchmarking after we have released all the planned functionality. This being said, it still performs reasonably well compared to Java client. We welcome any suggestions to make the client better and easier to work with. |
As of beta release, Hash objects are pooled now. There's also no heap allocations anymore.. |
Introducing .build.yml, for the new build system
I notice that the key.go: every time computing a digest for a key, it has to allocate a new slice. This will stress GC. In aerospike java client source code, I notice that thread-local buffer technique is used to improve this. But in Golang, there is no equivalent technique. I think why not to use a singleton buffer to hold data when computing key digest, instead of allocating a new slice many times?
The text was updated successfully, but these errors were encountered: