Skip to content
This repository has been archived by the owner on Dec 15, 2022. It is now read-only.

Eliminating some extra string copies #27

Closed
wants to merge 2 commits into from
Closed

Eliminating some extra string copies #27

wants to merge 2 commits into from

Conversation

omo
Copy link
Contributor

@omo omo commented Mar 19, 2015

Hi, I'm trying to harvest some low hanging fruits for atom/atom#979
before we make big changes. What do you think?

omo added 2 commits March 19, 2015 00:34
thanks for the @hokein's effort.

The test has an excessive long line. Making this benchmark fast
will result faster parsing for some real-world peculiar files.
OnigStringContext is an immutable object that encapsulates
various forms of v8String states, including UTF8 copy, UTF16 copy
and a predicate.

OnigStringContext is reusable, and it can eliminate extra string
copying if the same V8 string is given to FindNextMatchSync()
in subsequent calls.

Speedup:
 * large.js sync: 482ms -> 366ms
 * large.js async: 5914ms -> 4971ms (This number is noisy)
 * oneline sync: 66624ms -> 1085ms
 * oneline async: N/A (took to long)

Although there are some rooms for improvement in async case,
this overall seems good starting point to address slow-long-line
problem.
@omo omo closed this Mar 19, 2015
@omo omo deleted the string-context branch March 19, 2015 13:14
@omo
Copy link
Contributor Author

omo commented Mar 19, 2015

Re-opened this as #28

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant