-
-
Notifications
You must be signed in to change notification settings - Fork 665
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
[cs] funky String.lastIndexOf performance #7746
Comments
What does "hit" means there? I'm not sure what's the problem. Performances? |
Yes it's about performance. "hit" means that it uses a The performance characteristics suggests that it walks a large portion of the string instead of starting at |
I'm not surprised that several platforms exhibit the same behavior, as I mostly copy/pasted the implementation when adding a new platform. |
I made a small fix in lastIndexOf in ac8b78a |
I've opened HaxeFoundation/hashlink#239 not to forget about it |
HL
Our benchmarks suggest that lastIndexOf does something weird when there should be a match on the first attempt:
The "lastIndexOf hit" should have the same result as "indexOf hit" because the provided offset points directly at the substring we're looking for.
Neko has the same characteristics but I suppose we're not gonna fix that.
C#
This is also weird:
indexOf must be doing something worse than lastIndexOf here.
The text was updated successfully, but these errors were encountered: