Skip to content

Instantly share code, notes, and snippets.

@Nephos
Last active July 12, 2017 02:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Nephos/ad292a3e2acc9201e6ea6342eb85dacb to your computer and use it in GitHub Desktop.
Save Nephos/ad292a3e2acc9201e6ea6342eb85dacb to your computer and use it in GitHub Desktop.
@Nephos
Copy link
Author

Nephos commented Jul 12, 2017

f2   1.12M (892.42ns) (± 6.85%)  2.45× slower
f3   1.84M (542.11ns) (± 6.38%)  1.49× slower
f4   2.64M (378.86ns) (± 9.43%)  1.04× slower
f5   2.74M (364.86ns) (± 8.81%)       fastest
f2(STR) # => "this is a test with [my-page](/pages/my-page) and co"
f3(STR) # => "this is a test with [my-page](/pages/my-page) and co"
f4(STR) # => "this is a test with [my-page](/pages/my-page) and co"
f5(STR) # => "this is a test with [my-page](/pages/my-page) and co"

@Nephos
Copy link
Author

Nephos commented Jul 12, 2017

I don't think I can manage to get more performances than f4. I could be cool to do not have to allocate new sub-strings

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment