Skip to content
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

Improving performance with TCharObjectHashMap #31

Open
Yrlec opened this issue Feb 29, 2016 · 2 comments
Open

Improving performance with TCharObjectHashMap #31

Yrlec opened this issue Feb 29, 2016 · 2 comments

Comments

@Yrlec
Copy link

Yrlec commented Feb 29, 2016

Hi,
Thanks for this excellent library! We've just started using in all our clients for our backup service https://degoo.com and it has helped us speed up our progress calculations a lot.

When profiling I noticed that (at least in our use case) it spends quite a lot of time calling this.success.get(character) in State. In our case >50% of all execution time is spent there. My hunch is that this could be improved quite a lot by using Trove's TCharObjectHashMap. It would add an external dependency but it might be worth it if the performance enhancement is big enough. If adding an external dependency is not an option perhaps implementing something similar to TCharObjectHashMap would be a better solution. Let me know if we can be of any assistance with this.

Regards
Carl Hasselskog

@robert-bor
Copy link
Owner

Hi Carl. You're probably right. Why exactly do you think the TCharObjectHashMap is faster?

@cldellow
Copy link

In my experience, the alternative collections libaries like Trove, Goldman Sachs, HFTC, etc can sometimes perform better when primitives are involved. I don't know the details of why--avoiding unboxing? different hashing techniques? No clue.

I tried Carl's suggestion and used a TCharObjectHashMap to benchmark one of my usecases, where the trie has 200K case-sensitive keywords. It reduced parseText time by about 6%, but increased the time spent in building the trie by about 30%. I'm parsing terabytes of text, so for me even 6% is a big win.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants