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

Performance Enhancement Int to Int Comparison. #18

Open
STRATZ-Ken opened this issue Mar 2, 2018 · 2 comments
Open

Performance Enhancement Int to Int Comparison. #18

STRATZ-Ken opened this issue Mar 2, 2018 · 2 comments

Comments

@STRATZ-Ken
Copy link

STRATZ_Ken -
@howard You should change

https://github.com/odota/parser/blob/master/src/main/java/opendota/Parse.java#L726

with @OnEntityCreated. When CDOTA_NPC_Observer_Ward is created, store the DtClass().getClassId() in a variable. Then you can compare on ProcessEntity with int == int comparison. I just did this on my side on a lot of things monitored, lowered CPU across the board by 8%.

Howard - Today at 6:06 PM
Thanks, could you log an issue?

@howardchung
Copy link
Member

I created a PR testing this out, but didn't see much improvement.

I also timed the string comparison functions, and found that they took between 0.6 and 3 milliseconds per replay file. A replay parse takes about 3.5 seconds, so this is a pretty small improvement (0.1% at best)

@STRATZ-Ken
Copy link
Author

Still, dont see a reason to ever do string comparisons when you dont have too.

0.1% improvement on 200k matches per day would save you 116 minutes per day.

3.5s * 0.01 * 200k / 60 = 116.66minutes

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

2 participants