#port #word #ninja #splitting #english #english-words #ms

bin+lib wordninja

Word Ninja 英语单词分割库的 Rust 版本

1 个不稳定版本

0.1.0 2020年12月14日

#9 in #ms

MIT 许可证

545KB
172

Word Ninja

Word Ninja 是 wordninja 的 Rust 版本,通过了所有测试,并且速度显著提升。

性能

字符串分割

wethepeopleoftheunitedstatesinordertoformamoreperfectunionestablishjusticeinsuredomestictranquilityprovideforthecommondefencepromotethegeneralwelfareandsecuretheblessingsoflibertytoourselvesandourposteritydoordainandestablishthisconstitutionfortheunitedstatesofamerica
Benchmark #1: python t.py                                                                                                                                                                   0
  Time (mean ± σ):     188.9 ms ±   4.6 ms    [User: 0.9 ms, System: 5.5 ms]                                                                                                             0
  Range (min … max):   180.5 ms … 197.6 ms    15 runs

Benchmark #2: E:\Workspace\wordninja\target\release\wordninja.exe wethepeopleoftheunitedstatesinordertoformamoreperfectunionestablishjusticeinsuredomestictranquilityprovideforthecommondefencepromotethegeneralwelfareandsecuretheblessingsoflibertytoourselvesandourposteritydoordainandestablishthisconstitutionfortheunitedstatesofamerica
  Time (mean ± σ):      25.9 ms ±   1.0 ms    [User: 2.4 ms, System: 4.5 ms]                                                                                                             0
  Range (min … max):    24.1 ms …  29.8 ms    92 runs

Summary
  'E:\Workspace\wordninja\target\release\wordninja.exe wethepeopleoftheunitedstatesinordertoformamoreperfectunionestablishjusticeinsuredomestictranquilityprovideforthecommondefencepromotethegeneralwelfareandsecuretheblessingsoflibertytoourselvesandourposteritydoordainandestablishthisconstitutionfortheunitedstatesofamerica' ran
    7.31 ± 0.32 times faster than 'python t.py'

依赖

~760KB