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

Avoid repeated creation of a simple RegExp object. #5151

Merged

Conversation

nnethercote
Copy link
Contributor

This helps avoid creation of tens or hundreds of thousands of objects for the doc in #4487, which reduces cumulative memory allocations by about 2%. Not a huge improvement, but not bad for something so simple.

@CodingFabian
Copy link
Contributor

nice. I assume its not worth extracting the regex from
https://github.com/mozilla/pdf.js/blob/master/src/core/network.js#L193
because its only called tens to hundreds of times?

@CodingFabian
Copy link
Contributor

@nnethercote
Copy link
Contributor Author

Worth extracting as well?

Depends how hot they are. I haven't seen them come up in any of my memory profiles. Anything less than 10,000 executions probably isn't worth bothering with.

@timvandermeij
Copy link
Contributor

/botio-linux preview

@pdfjsbot
Copy link

pdfjsbot commented Aug 8, 2014

From: Bot.io (Linux)


Received

Command cmd_preview from @timvandermeij received. Current queue size: 0

Live output at: http://107.21.233.14:8877/1c8b714961186df/output.txt

timvandermeij added a commit that referenced this pull request Aug 8, 2014
Avoid repeated creation of a simple RegExp object.
@timvandermeij timvandermeij merged commit defb67c into mozilla:master Aug 8, 2014
@timvandermeij
Copy link
Contributor

Looks good. Thank you!

@nnethercote nnethercote deleted the text_layer_builder-regexp branch August 12, 2014 04:08
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.

4 participants