-
-
Notifications
You must be signed in to change notification settings - Fork 11
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
Possible string length algorithm #348
Comments
Thanks, are you suggesting a new type For length, I can think of doing it like this:
Have not test it but I think that will work. |
Yeah, sadly that won't work. It currently only makes the |
At, I see. I actually saw that issue before and 👍 it but forgot. 😀 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I devised a fast logarithmic string length algorithm based on carefully building string type patterns which is surprisingly tedious due to
${string}${string}
simplifying to${string}
so we need to add an extra character$
before and after during all of our checks.Anyways, this string length algorithm supports getting the length of strings up to 10,000 characters long (uses tuples for math). However, you could add an alternate path after the cache gets to 2^13 (8,192) to use your arbitrary math type to support more strings up until a very large size due to beauty of the logarithmic scale.
The code is quite ugly so there still might be some opportunities for simplification.
The text was updated successfully, but these errors were encountered: