Skip to content
This repository was archived by the owner on Feb 3, 2025. It is now read-only.

First try making something fast #1

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

janlucaklees
Copy link

Check List:

  • Tests pass (./test.sh <username> shows no differences between expected and actual outputs)
  • All formatting changes by the build are committed
  • Your launch script is named calculate_average_<username>.sh (make sure to match casing of your GH user name) and is executable
  • Output matches that of calculate_average_baseline.sh
  • Execution time: 0m39.814s
  • Execution time of reference implementation: 12m40.025s

Further notes

  • I adapted the pom.xml to use Java version 22.
  • I am on Bun version 1.1.10
  • Output matches when logging to the console. Redirecting the output to a file does not work for some reason.

Thanks for hosting the challenge, @Edgar-P-yan!

Finally, after much trial, error and testing I came to this version
which is moderately fast.
Here I removed the need for using TextDecoder for processing the
location name.
I had to implment my own sorting function, which might not sort 100%
correct, but it passed the tests.
Without the TextDecoder my implementation is much faster.

I also fixed a bug, where I forgot to process the end of the file.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant