ambuda-org / vidyut

Infrastructure for Sanskrit software. For Python bindings, see `vidyut-py`.
48 stars 21 forks source link

Explore using `CompactString` in segmenter #8

Closed akprasad closed 1 year ago

akprasad commented 1 year ago

CompactString is a memory-efficient string that can store up to 24 bytes on the stack before making a heap allocation. It's mostly a drop-in replacement for String, and you can learn more about it here.

We've had success improving performance by using CompactString in vidyut-prakriya, and it might also improve performance in vidyut-cheda.

A PR here would experiment with CompactString and quantify the performance change.

akprasad commented 1 year ago

Done in 39cad7b as part of a series of other small optimizations. The result is that Chedaka::run is around 2x faster.