-
Notifications
You must be signed in to change notification settings - Fork 95
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
Request for CS2 parser optimisation suggestions #425
Comments
Hey @Ektaros - thanks for opening this issue. I have noticed the same thing and would definitely like to improve the performance. Unforunately with the CS2 demo format being quite different from CS:GO this is not super easy and will take some time. It's also unlikely it will ever be as fast as CS:GO, but hopefully we can at least make it a bit faster over time. |
Hello @markus-wa Before: After: Are you sure this check is still necessary? |
yeah that check is definitely necessary - but we can probably optimise it by caching this on I'm pretty confident that caching will be comparable in performance to removing the check. nice find! |
Ok thanks! I will look into this |
If may, I actually find it rather strange that field paths are managed in a pool. They do not look at all like heavy weight objects to me. I suspect that the overhead from the synchronization built into the pool may be much higher than if we simply created new instances as needed. |
I think the issue was GC overhead as the field paths are allocated on the heap. If we add caching this may no longer be necessary. Probably best to do some A/B testing with pprof and look at both speed and alloc_objects |
Or maybe we can make sure they are allocated on the stack instead |
Thanks for the suggestion @esbengc I tried that, removing the pool on the current master provides ~5-7% increase in speed, but there are ~10-15% more mem usage and allocated objects. I do not have any idea how to make sure that fp objects are allocated on the stack, cause they get passed around a lot. |
yeah that indeed sounds like a good tradeoff. as for stack alloc we'd need to remove all pointers to them (and then pray to the Go gods) - e.g. by returning the value instead of passing a pointer through the whole call chain. but I think your suggested changes are good enough as is and with caching I doubt this would actually make much of a difference. so let's leave it as is unless profiling shows we still have issues in this area |
Hello!
I am currently working on optimising cs2 parser.
cs:go parser is fast, but cs2 is several times slower. I could not figure out why myself tho :(
Mb you have an idea what parts of the code could be responsible for this difference in speed between cs:go and cs2?
Thanks in advance!
The text was updated successfully, but these errors were encountered: