-
-
Notifications
You must be signed in to change notification settings - Fork 544
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
Reverse-string: add a test case with a longer string #1983
Comments
Do you know how long the string would have to be for it to be noticeable in benchmarks? Usually that would be something that an analyzer or mentor would discuss with the student though, not part of the test suite. |
With the current test suite (in Go), the speedup is about factor 2. After adding a 100 character string to the test, the speedup is closer to a factor 4. (Usual disclaimers about micro-benchmarks apply.) |
To be more precise - the Go benchmark test for |
I think a 100 character string would definitely be reasonable to have. I'd be in favour of adding it if you want to open a PR. |
I recently mentored a student on
ReverseString
who had started off with a naive algorithm that had quadratic complexity. It was a bit disappointing to see that in the benchmarks, the speedup was not that great. I noticed that all the sample strings in the test suite are rather short. Maybe we could add at least one longer string so that the performance gains of a better algorithm become more impressive?The text was updated successfully, but these errors were encountered: