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
Propose: use an fast int-int map to cache type information #194
Comments
Thank you for the reporting ! |
I will draft a change to check the benchmark result ~ |
This comment has been minimized.
This comment has been minimized.
Well, the previous comment is incorrect, I'll post a new benchark result later soon. |
Here is a new updated benchmark result
|
oops... I have closed the issue by mistake, how can I reopen it ? |
Change-Id: Icb767d22b6c1b2cad991c53f3f450f5eb3f773b1
Change-Id: Icb767d22b6c1b2cad991c53f3f450f5eb3f773b1
I have send another pull request to enable slice cache for 32x larger type address range as I guess we can pending this PR untill we find that it really worth the complexity. |
Hi, this json package is awesome, the performance is very impressive.
I saw the idea of "Dispatch by typeptr from map to slice" is limited by the type slice size and I got an idea to help this.
Some time ago, I discovered a very fast int key to int value map implemention here: https://github.com/brentp/intintmap/.
From my recent benchmark, it shows that a further optimized copy-on-write version of the int-int map can be nearly fast as slice index (without unsafe slice bounds checking elimination), I think it may be a better choice than the current implementation, and it doesn't waste memory.
The benchmark code is here:
https://github.com/jxskiss/gopkg/blob/master/intintmap/cow_test.go
Do you think it's a good idea to use the int-int map for the codec cache?
I can send a PR if it's welcomed.
(PS. saying the int-int map, I am not meaning to introduce external dependencies, we can just implement the functionality that we need for the type information cache.)
The text was updated successfully, but these errors were encountered: