alasdairforsythe / tokenmonster

Ungreedy subword tokenizer and vocabulary trainer for Python, Go & Javascript
MIT License
528 stars 20 forks source link

Humble question regarding JS performance #27

Closed worstpractice closed 8 months ago

worstpractice commented 9 months ago

First and foremost, very impressive work!

As a low-level JS performance enthusiast, I'd be interested to see how much faster I'd be able to make the JS implementation on V8 in particular (with expected gains across all JITs I'm aware of).

And by "faster" it's of course implied to mean repeatably, measurably, explainably, and significantly faster. (Just say no to microbenchmarks).

Main strategies include well-known run-of-the-mill techniques like enforcing 100% monomorphic code and other related JIT-appeasing goodness.

Would this be of any interest whatsoever to you? Absolutely fine if not, but I wanted to extend you a nerdy E.T. glow-finger of enthusiasm and test the waters before deciding to proceed on my own instead.

Apologies in advance for sending this much text your way unsolicited.

All the best, and again, great work. 👏

alasdairforsythe commented 8 months ago

I'm personally not going to work on the JS side of it more as it's purpose was for the browser demonstration. There are many opportunities for improving the efficiency on the JS side.