4 ms·
Why are you allocating in your standard implementation's Check function? That can't be good for performance.
by bradfitz 13y ago
Why are you allocating in your standard implementation's Check function? That can't be good for performance.
- zhenjl 13y agoSorry for the delay in responding there. Hadn't check this for a couple of days. You are correct. In fact, I am allocating in both standard and partitioned Check() implementations, in the bits() func. I can pre-allocate during New() and keep using the same slice without re-make. Thanks for the suggestion! I will update and re-run. I also need to go back and figure out the murmur3 implementation is not working.
- zhenjl 13y agoAuthor here. (same comment posted to reddit) @bradfitz thanks for the comments and suggestion. I updated the code based on your suggestion (not allocate for every add/check) and the performance improved by 25+%!! Appreciate it! I updated the blog and here's the gist that contains the latest results: https://gist.github.com/zhenjl/6515577 https://gist.github.com/zhenjl/6515577