-
-
Notifications
You must be signed in to change notification settings - Fork 262
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
Excessive Allocation for StringExp with Cache #3490
Comments
Seems to make perfect sense, would you mind opening a PR with your suggested changes? |
Yah I'll make them tomorrow. The only thing is, I'm not sure what to do about eliminating I'll make a PR tomorrow, and look into this a bit more maybe tomorrow. |
Yeah,
So I hope they can deal with intermediate zeros for w/dstrings too. It works with |
There's an issue where
e->toChars()
linked below, allocates new memory and the string can be rather large sometimes. It is building a "header" pretty version of the string, so for a large string it allocates quite a bit extra memory (x3) each time. I tried it with peekString() and was able to reduce compile time of one my projects by about 1 second (from a 19 second total). Iimport("...")
quite a few files but the sizes aren't that big but still quite significant considering what this code is doing.Don't think peekString() would be portable though, all my strings are just regular strings. Any better ideas?
Some of the other optimizations below wouldn't be necessary if something else was used instead of the actual string. But otherwise they are quite slow for larger strings.
https://github.com/ldc-developers/ldc/blob/v1.22.0/gen/toir.cpp#L394
The text was updated successfully, but these errors were encountered: