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

int to long performance hit? #1461

Closed
benjchristensen opened this issue Jul 17, 2014 · 1 comment
Closed

int to long performance hit? #1461

benjchristensen opened this issue Jul 17, 2014 · 1 comment

Comments

@benjchristensen
Copy link
Member

PR #1443 changing request(int n) to request(long n) appears to have caused a non-trivial performance hit in the JMH tests.

Before:

Benchmark                                    (size)   Mode   Samples        Score  Score error    Units
r.o.OperatorMergePerf.merge1SyncStreamOfN         1  thrpt         5  5246591.736   240800.312    ops/s
r.o.OperatorMergePerf.merge1SyncStreamOfN      1000  thrpt         5    57309.810     3333.567    ops/s
r.o.OperatorMergePerf.merge1SyncStreamOfN   1000000  thrpt         5       60.163        1.654    ops/s

After:

Benchmark                                    (size)   Mode   Samples        Score  Score error    Units
r.o.OperatorMergePerf.merge1SyncStreamOfN         1  thrpt         5  4940791.384   317585.017    ops/s
r.o.OperatorMergePerf.merge1SyncStreamOfN      1000  thrpt         5    27655.680     2216.176    ops/s
r.o.OperatorMergePerf.merge1SyncStreamOfN   1000000  thrpt         5       30.091        1.015    ops/s
@benjchristensen
Copy link
Member Author

Found it ... it was changing from -1 to Long.MAX_VALUE and one of the fast-path conditionals was missed (it was checking for > 0 rather than == -1 so was missed.

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

1 participant