yeraydiazdiaz / lunr.py

A Python implementation of Lunr.js 🌖
http://lunr.readthedocs.io
MIT License
188 stars 16 forks source link

Lunr.py Performance #86

Closed GabrielGhe closed 4 years ago

GabrielGhe commented 4 years ago

I ran the same query on lunr.js and lunr.py to test the performance and the python implementation is 4x slower.

I think it could be fixed by using multiprocessing but it still might not match javascript's speed.

yeraydiazdiaz commented 4 years ago

Hi @GabrielGhe, I noticed that too, but performance parity with lunr.js was never a design goal.

The task itself is pretty much exactly where pure Python just doesn't shine compared to JavaScript, Anthony Shaw describes it quite well in his PyCon US talk.

That being said I certainly have relative performance between versions in mind as I've developed lunr.py. I've setup benchmarks and done some investigation on using extensions, but the development overhead is much too high for a performance benefit that most users probably wouldn't notice or care.