GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Speedup String#{ indexOf, lastIndexOf } by MaxGraey · Pull Request #2649 · AssemblyScript/assemblyscript

Conversation

@MaxGraey

@MaxGraey MaxGraey commented Feb 13, 2023 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

This speedup indexOf matching, especially for long strings and single character.

Benchmark results:

Old
 - SAMPLE22_0:ok:  69.700 ms
 - SAMPLE22_0:eof: 49.000 ms
 - SAMPLE63_1:ok:  90.700 ms
 - SAMPLE63_1:eof: 87.200 ms
 - SAMPLE1k_h:ok:  345.100 ms
 - SAMPLE1k_h:eof: 723.800 ms

New
 - SAMPLE22_0:ok:  40.600 ms  (~1.7x)
 - SAMPLE22_0:eof: 39.400 ms  (~1.3x)
 - SAMPLE63_1:ok:  64.900 ms  (~1.4x)
 - SAMPLE63_1:eof: 54.900 ms  (~1.6x)
 - SAMPLE1k_h:ok:  318.900 ms (~1.0x)
 - SAMPLE1k_h:eof: 350.800 ms (~2.0x)

Benchmark Playground: https://tinyurl.com/pjftv9pp

  • I've read the contributing guidelines
  • I've added my name and email to the NOTICE file

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
MaxGraey added 17 commits February 13, 2023 21:22
@MaxGraey
wip
cbd7eb2
@MaxGraey
fix
087eb1f
@MaxGraey
better
eb8a25f
@MaxGraey
fix
618e13c
@MaxGraey
better
c8b53f5
@MaxGraey
refactor
4bc5145
@MaxGraey
simplify
c12a3a0
@MaxGraey
refactor
4404ad6
@MaxGraey
refactor
7ceeea0
@MaxGraey
less parens
6b5145c
@MaxGraey
more
927f9ca
@MaxGraey
Merge branch 'main' into opt-single-char-comp
95ea83c
@MaxGraey
more indexOf tests
6cb592e
@MaxGraey
more
fea3106
@MaxGraey
lastIndexOf wip
7f4c9ef
@MaxGraey
more fast paths
6117265
@MaxGraey
upd lock
56248f7
@MaxGraey MaxGraey changed the title Speedup String#{ indexOf, lastIndexOf } is needle is single character Speedup String#{ indexOf, lastIndexOf } Feb 19, 2023
@MaxGraey
MaxGraey marked this pull request as ready for review February 19, 2023 10:53
@MaxGraey MaxGraey added enhancement performance standard library labels Feb 19, 2023
MaxGraey added 5 commits February 19, 2023 19:49
@MaxGraey
finish findCodePointBackward
5cebdb0
@MaxGraey
fix?
d96336c
@MaxGraey
fix + more tests
111330b
@MaxGraey
fix
c248ffd
@MaxGraey
fix?
6a7035a
@MaxGraey
MaxGraey marked this pull request as draft February 20, 2023 20:40

This branch has not been deployed

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

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

enhancement performance standard library

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

1 participant

@MaxGraey
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.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.