ColinEberhardt / assemblyscript-regex

A regex engine for AssemblyScript
MIT License
86 stars 12 forks source link

Optimize CharacterSetMatcher #21

Closed MaxGraey closed 3 years ago

MaxGraey commented 3 years ago

Sometimes better use switch case with explicit supeclass casts instead indirect calls via vtable

ColinEberhardt commented 3 years ago

Aha, I wonder whether this fixes the issue here?

https://github.com/ColinEberhardt/assemblyscript-regex/blob/main/assembly/regexp.ts#L155-L179

Can you do me a favour? would you mind rebasing onto the latest commit? (https://github.com/ColinEberhardt/assemblyscript-regex/commit/482ee80448f428b36e2460dbe7c759a4e3ace485)

I've added benchmarking to the CI, however had not enabled it for PRs

MaxGraey commented 3 years ago

Aha, I wonder whether this fixes the issue here?

Maybe

Can you do me a favour? would you mind rebasing onto the latest commit?

Sure. Could you also use optimized.wasm instead untouched.wasm for benchmark here: https://github.com/ColinEberhardt/assemblyscript-regex/blob/main/benchmark/benchmark.js#L8?

ColinEberhardt commented 3 years ago

Sure. Could you also use optimized.wasm instead untouched.wasm for benchmark here:

Good spot - I'll make that change shortly. @willemneal is making some significant changes to the tests #19 so I don't want to make any more changes in that area just now.

MaxGraey commented 3 years ago

Hmm, CI output: 'auto-push' is enabled but 'github-token' is not set. Please give API token to push GitHub pages branch to remote

ColinEberhardt commented 3 years ago

Hmm, CI output: 'auto-push' is enabled but 'github-token' is not set.

Ahh - I'll sort that out. I'll get this PR merged regardless

ColinEberhardt commented 3 years ago

Merged via #22

https://github.com/ColinEberhardt/assemblyscript-regex/pull/22/commits/5fcaf2a1d16eae1b9ae16fb71863b58021012826 😄

MaxGraey commented 3 years ago

Wait but how about changes in benchmark scripts? =)

ColinEberhardt commented 3 years ago

Wait but how about changes in benchmark scripts? =)

I'll get to that ;-)

These changes have had a small +ve improvement on performance: https://colineberhardt.github.io/assemblyscript-regex/dev/bench/

MaxGraey commented 3 years ago

Great. But it still bench unoptimized.wasm. Much more sense benchmarking optimized.wasm