Closed aglinxinyuan closed 2 years ago
Hi, thank you for the PR, good results. However, I don't think the library is at a stage to start micro-optimizing all the functions. If you have an improvement that is still easy to maintain then that would be much appreciated but this improvement takes away from maintainability and understandability which we prioritize higher than efficiency.
Improve ngram performance by 20%.
random_hv(10,10000) 99.1 µs ± 1.63 µs per loop (mean ± std. dev. of 7 runs, 10,000 loops each) 78 µs ± 1.05 µs per loop (mean ± std. dev. of 7 runs, 10,000 loops each)