Skip to content
Fast counters for Python
Python
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.circleci Fix CircleCI regex Nov 22, 2019
fastcounter Simplify FastWriteCounter init Nov 22, 2019
.gitignore Initial commit Nov 22, 2019
.mergify.yml Initial commit Nov 22, 2019
README.rst Initial commit Nov 22, 2019
config.yml Initial commit Nov 22, 2019
pyproject.toml Initial commit Nov 22, 2019
setup.cfg Initial commit Nov 22, 2019
setup.py Initial commit Nov 22, 2019
tox.ini Initial commit Nov 22, 2019

README.rst

Fastcounter

https://circleci.com/gh/jd/fastcounter.svg?style=svg Mergify Status

Fastcounter is an Apache 2.0 licensed fast counter library written in Python. It aims at implementing fast incremental integer with different trade-offs on performance depending on your use case.

It provides 3 classes:

  • Counter, a simple integer counter that does not support any concurrency.
  • FastWriteCounter, a counter that is thread-safe and is faster at writing than reading.
  • FastReadCounter, a counter that is thread-safe and is faster at reading than writing.

Example:

import fastcounter

counter = fastcounter.Counter()

counter.value # returns 1
counter.increment()
counter.value # returns 2
You can’t perform that action at this time.