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

[Julia] move topn definition into body of @threads #182

Merged
merged 1 commit into from
Oct 10, 2023

Conversation

LilithHafner
Copy link
Contributor

Julia is worried that topn might be mutated and so deoptimizes. The Julia people should really figure this out because there is literally only one assignment to topn, but whatever, moving the definition into the body of the loop speeds things up.

I also removed trailing whitespace.

@algunion
Copy link
Contributor

Julia is worried that topn might be mutated and so deoptimizes. The Julia people should really figure this out because there is literally only one assignment to topn, but whatever, moving the definition into the body of the loop speeds things up.

This small (well - not so small given the deoptimization effect) thing speeds things up by about 20% (8ms -> a little over 6ms on my machine).

@Tortar
Copy link
Contributor

Tortar commented Oct 29, 2023

This pull request was closed.
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

Successfully merging this pull request may close these issues.

4 participants