-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
[stdlib] Micro-optimize string splitlines
and isnewline
#3825
Closed
Conversation
This file contains 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
Signed-off-by: martinvuyk <[email protected]>
Signed-off-by: martinvuyk <[email protected]>
JoeLoser
approved these changes
Dec 4, 2024
!sync |
!sync |
!sync |
✅🟣 This contribution has been merged 🟣✅ Your pull request has been merged to the internal upstream Mojo sources. It will be reflected here in the Mojo repository on the nightly branch during the next Mojo nightly release, typically within the next 24-48 hours. We use Copybara to merge external contributions, click here to learn more. |
modularbot
pushed a commit
that referenced
this pull request
Dec 10, 2024
…` (#52307) [External] [stdlib] Micro-optimize string `splitlines` and `isnewline` ## Micro-optimize string `splitlines` and `isnewline`. Benchmark results: CPU: Intel® Core™ i7-7700HQ improvement metric: markdown percentage improvement (`(old_value - new_value) / old_value`) Average improvement: 1.2% . Many of the discrepancies are likely because of runtime (nano-second scale) pipelining (and other) differences during testing. The most robust estimates are the biggest tests which show around 4.2% improvement. |Name | old_value (ms) | new_value (ms) | improvement| |:-----------------------------|---------------------:|----------------:|------:| |`bench_string_splitlines[10]` | 0.000100497059839818 | 0.00010261460376 | -2.11% | |`bench_string_splitlines[30]` | 0.000171998352418428 | 0.000174028055158599 | -1.18% | |`bench_string_splitlines[50]` | 0.000264958575880379 | 0.000251598931395228 | 5.04% | |`bench_string_splitlines[100]` | 0.000417350538881514 | 0.000415764808815687 | 0.38% | |`bench_string_splitlines[1000]` | 0.00320600819966129 | 0.00322517645847026 | -0.60% | |`bench_string_splitlines[10000]` | 0.0302790238107332 | 0.0305872863513719 | -1.02% | |`bench_string_splitlines[100000]` | 0.319274428592796 | 0.304513179279761 | 4.62% | |`bench_string_splitlines[1000000]` | 3.24098357344348 | 3.10220707742267 | 4.28% | Co-authored-by: martinvuyk <[email protected]> Closes #3825 MODULAR_ORIG_COMMIT_REV_ID: 433b5ea2f49164bf08572004da1541ac42f1eed2
Landed in fc9fe84! Thank you for your contribution 🎉 |
modularbot
pushed a commit
that referenced
this pull request
Dec 17, 2024
…` (#52307) [External] [stdlib] Micro-optimize string `splitlines` and `isnewline` ## Micro-optimize string `splitlines` and `isnewline`. Benchmark results: CPU: Intel® Core™ i7-7700HQ improvement metric: markdown percentage improvement (`(old_value - new_value) / old_value`) Average improvement: 1.2% . Many of the discrepancies are likely because of runtime (nano-second scale) pipelining (and other) differences during testing. The most robust estimates are the biggest tests which show around 4.2% improvement. |Name | old_value (ms) | new_value (ms) | improvement| |:-----------------------------|---------------------:|----------------:|------:| |`bench_string_splitlines[10]` | 0.000100497059839818 | 0.00010261460376 | -2.11% | |`bench_string_splitlines[30]` | 0.000171998352418428 | 0.000174028055158599 | -1.18% | |`bench_string_splitlines[50]` | 0.000264958575880379 | 0.000251598931395228 | 5.04% | |`bench_string_splitlines[100]` | 0.000417350538881514 | 0.000415764808815687 | 0.38% | |`bench_string_splitlines[1000]` | 0.00320600819966129 | 0.00322517645847026 | -0.60% | |`bench_string_splitlines[10000]` | 0.0302790238107332 | 0.0305872863513719 | -1.02% | |`bench_string_splitlines[100000]` | 0.319274428592796 | 0.304513179279761 | 4.62% | |`bench_string_splitlines[1000000]` | 3.24098357344348 | 3.10220707742267 | 4.28% | Co-authored-by: martinvuyk <[email protected]> Closes #3825 MODULAR_ORIG_COMMIT_REV_ID: 433b5ea2f49164bf08572004da1541ac42f1eed2
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
imported-internally
Signals that a given pull request has been imported internally.
merged-externally
Merged externally in public mojo repo
merged-internally
Indicates that this pull request has been merged internally
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.
Micro-optimize string
splitlines
andisnewline
.Benchmark results:
CPU: Intel® Core™ i7-7700HQ
improvement metric: markdown percentage improvement (
(old_value - new_value) / old_value
)Average improvement: 1.2% . Many of the discrepancies are likely because of runtime (nano-second scale) pipelining (and other) differences during testing. The most robust estimates are the biggest tests which show around 4.2% improvement.
bench_string_splitlines[10]
bench_string_splitlines[30]
bench_string_splitlines[50]
bench_string_splitlines[100]
bench_string_splitlines[1000]
bench_string_splitlines[10000]
bench_string_splitlines[100000]
bench_string_splitlines[1000000]