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

Reading and parsing optimizations: CalculateAverage_spullara #21

Merged
merged 22 commits into from Jan 3, 2024

Conversation

spullara
Copy link
Contributor

@spullara spullara commented Jan 2, 2024

On my MacBook Pro M3 Ultra:

CalculateAverage: 2m37.788s
CalculateAverage_royvanrijn: 0m29.639s
CalculateAverage_spullara: 0m6.278s

Mostly optimized reading the file and parsing it.

@spullara spullara changed the title Reading and parsing optimizations Reading and parsing optimizations: CalculateAverage_spullara Jan 2, 2024
@spullara
Copy link
Contributor Author

spullara commented Jan 2, 2024

I find that the actual runtimes vary quite a bit from run to run. Not sure what is causing that. Happens on both Windows & Mac. Might be something related to file caching.

@spullara
Copy link
Contributor Author

spullara commented Jan 2, 2024

Using Graal, it gets down to ~4.5s.

@deemkeen
Copy link
Contributor

deemkeen commented Jan 2, 2024

@spullara really cool, i even get a slightly better performance with Executors.newVirtualThreadPerTaskExecutor() instead of the fixed threadPool

@spullara
Copy link
Contributor Author

spullara commented Jan 2, 2024

Latest commit slightly beats the performance of the leaderboard leader at 2900ms using GraalVM. FileChannel was the key to closing the gap. Have to see if improving the hash map helps a lot.

@spullara
Copy link
Contributor Author

spullara commented Jan 3, 2024

Now down to 2s after writing my own hash map.

@gunnarmorling
Copy link
Owner

Very nice, clocking in at 00:14.848 in the evaluation environment!

@gunnarmorling gunnarmorling merged commit c832d64 into gunnarmorling:main Jan 3, 2024
1 check passed
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.

None yet

3 participants