I'm porting a python NLP module to nim,it results 4 times slower than python 
version.

It's for Chinese word segment task.

you can see the main test file(takes about 5 second):

[https://github.com/bung87/finalseg/blob/master/tests/test2.nim](https://github.com/bung87/finalseg/blob/master/tests/test2.nim)

and python version test(takes about 1 second):

[https://github.com/bung87/finalseg/blob/master/tests/speed.py](https://github.com/bung87/finalseg/blob/master/tests/speed.py)

the original python module file:

[https://github.com/fxsjy/jieba/blob/master/jieba/finalseg/__init__.py](https://github.com/fxsjy/jieba/blob/master/jieba/finalseg/__init__.py)

nim :Nim Compiler Version 0.18.0 [MacOSX: amd64]

python:Python 3.6.5 (default, Jun 17 2018, 12:13:06)

cup:2.7 GHz Intel Core i5

ram:8 GB 1867 MHz DDR3

Reply via email to