Skip to content
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

Cherry-pick "LibJS: Allocate RegExp.{lastMatch,leftContext,rightContext} lazily" #25699

Merged
merged 1 commit into from
Feb 9, 2025

Conversation

nico
Copy link
Contributor

@nico nico commented Feb 9, 2025

These properties are always substrings of the RegExp input string, and so we can store them as views and lazily construct strings if they're actually accessed (which most of the time they aren't).

This avoids a bunch of unnecessary memory copying, saving roughly 2.1 seconds per iteration of Speedometer.

(cherry picked from commit dbf52a1b5fa9d7e81816ffc6c5a587c832148bd8)


LadybirdBrowser/ladybird#3506

These properties are always substrings of the RegExp input string,
and so we can store them as views and lazily construct strings if
they're actually accessed (which most of the time they aren't).

This avoids a bunch of unnecessary memory copying, saving roughly
2.1 seconds per iteration of Speedometer.

(cherry picked from commit dbf52a1b5fa9d7e81816ffc6c5a587c832148bd8)
@github-actions github-actions bot added the 👀 pr-needs-review PR needs review from a maintainer or community member label Feb 9, 2025
@nico nico merged commit 6987a6e into SerenityOS:master Feb 9, 2025
12 checks passed
@nico nico deleted the pr_3506 branch February 9, 2025 01:52
@github-actions github-actions bot removed the 👀 pr-needs-review PR needs review from a maintainer or community member label Feb 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants