Merged
Conversation
8a9fd02 to
093a766
Compare
Contributor
Author
|
Example benchmark: This version: 0.73s user 0.13s system 131% cpu 0.652 total |
Contributor
|
This is a good idea. We should tune it on some realistic benchmarks if possible. I think having a native deep join that will do 2 passes over the tree will still be faster in the case of manifest functions, but obviously that is more of an expert approach. |
093a766 to
79a1617
Compare
Contributor
Author
|
I rebased it and changed the names of string representations to something a little bit more concrete. @sparkprime Can we merge this? |
79a1617 to
763b62e
Compare
When adding long strings, don't copy them immediately. Instead build long strings only when their contents are requested. This allows to build a long string from parts, using a regular operator+ in linear time. This lets users to worry much less about using std.join etc. If indexing the string is mixed with building it using operator+ the behavior can still be quadratic. We may want to address it in a later change.
763b62e to
8407897
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When adding long strings, don't copy them immediately. Instead
build long strings only when their contents are requested.
This allows to build a long string from parts, using a regular
operator+ in linear time. This lets users to worry much less
about using std.join etc.
If indexing the string is mixed with building it using operator+
the behavior can still be quadratic. We may want to address it in
a later change.
Depends on: #229