Python
So why would anyone replace the easy-to-use PyBind11 with almost 2,000 lines of pure CPython bindings?! Of course, to lower the latency! PyBind11 wraps every C++ object with a smart pointer, puts a hash table next to it, and addresses function pointers with `std::string` key lookups ๐คฏ
Let's see where it gets us if benchmarking with the "Leipzig1M" dataset. The bandwidth-oriented functions are just as fast as in the past:
- Hashing the dataset: 77 ms for ๐ vs 16 ms for ๐ฆ ~ __4.5x faster__
- Counting the number of "the": 151 ms for ๐ vs 45 ms for ๐ฆ ~ __3.3x faster__
- Split all whitespace-delimited words: 782 ms for ๐ vs 338 ms for ๐ฆ~ __2.3x faster__
- Split around every "the": 240 ms for ๐ vs 48 ms for ๐ฆ ~ __5x faster__
What about the latency-oriented ones?
- Find the first whitespace: 1 ยตs for ๐ vs 3 ยตs for ๐ฆ ~ ___3x slower___, where previously it was 15ยต and __15x slower__
- Partition around the first whitespace: 73 ms for ๐ vs 33 ยตs for ๐ฆ ~ __2212x faster__ ๐ฅณ
JavaScript
In an effort to bring faster string operations, together with nairihar, we have started the NodeJS binding. It's just a skeleton, and has poor performance for now, but you can use it as a starting point to help us implement faster `Str` class for JavaScript ๐ค