-
Notifications
You must be signed in to change notification settings - Fork 59
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
Question: is it worth to store the reference to a map? #1006
Comments
I created a small program to test getting the map all the time or only ones, and it is like 90% faster to only get it ones. Standard scenario response time: 21.9712609s Optimized scenario response time: 11.0851385s Standard scenario response time (parallel): 1.0739231s Optimized scenario response time (parallel): 320.1793ms
|
Go version: 1.22.4
Hazelcast Go Client version: v1.4.2
Simple question:
we use HZ to store token information with some maps, not too many (5),
We do like 1000 req/s to 3 or 4 maps, but for every single request to the map.get we get the map first. (GetMap)
We could store the map reference in a "golang map" (as we have a generic interface with HZ) in our code instead of relaying on the HZ function to get the map.
Would this be worth it? Is the GetMap doing a request to the server every single time? I checked the code of the library and seems to save some references internally...
`
`
like somethink like (pseudo code):
map, ok := mymaps[mapName] if !ok { map = repo.Cache.GetMap(ctx, mapName) mymaps[mapName] = map }
Thank you
The text was updated successfully, but these errors were encountered: