Skip to content
Branch: master
Find file History
Latest commit 2bb0d05 Mar 22, 2019
Permalink
Type Name Latest commit message Commit time
..
Failed to load latest commit information.
src Simpler new and clippy fixes Feb 23, 2019
tests remove meaningless __future__.absolute_import Oct 9, 2018
word_count Remove unrequired encoding header Mar 3, 2019
Cargo.toml Migrate to rust 2018 Feb 1, 2019
README.md
pyproject.toml
requirements-dev.txt Add tox config for word-count Oct 9, 2018
setup.py use pytest directlly instead of python -m pytest Oct 9, 2018
tox.ini Drop support for python2 Mar 29, 2019

README.md

word-count

Demonstrates searching for a file in plain python, with rust singlethreaded and with rust multithreaded.

Build

python setup.py install

Usage

from word_count import search_py, WordCounter

search_py("path/to/file", "word")
WordCounter("path/to/file").search("word")
WordCounter("path/to/file").search_sequential("word")

Benchmark

Install the depedencies:

pip install -r requirements-dev.txt

There is a benchmark in tests/test_word_count.py:

pytest -v tests

Testing

To test python 3.5, 3.6 and 3.7, install tox globally and run

tox
You can’t perform that action at this time.