A monkey patch for prometheus_client, using GCC atomics for extra speed on CPython
Project description
cPrometheus
===========
Make `prometheus_client` go faster, with zero effort.
```
import cPrometheus # MOAR speed
# Now do stuff with prometheus_client, but faster
import prometheus_client
# ...
```
Note: This is not compatible with multiprocess mode. If you are using
multiprocess mode, this package is not for you.
How It Works
------------
Internally, `prometheus_client` stores values in a class called `_MutexValue`.
As the name suggests, this class is protected by a mutex, and can become a
bottleneck when placed in tight inner loops.
This package monkey patches `prometheus_client` to use its own class,
`_AtomicValue`, which internally uses gcc's `__atomic` operations.
Yes, I know `stdatomic` is more portable, but I've got a requirement to
support gcc 4.8.
Further Work
------------
- Be more portable
- Consider stealing Java 8 `DoubleAdder`'s design, if even more speed is
needed.
- Can multiprocess be done?
===========
Make `prometheus_client` go faster, with zero effort.
```
import cPrometheus # MOAR speed
# Now do stuff with prometheus_client, but faster
import prometheus_client
# ...
```
Note: This is not compatible with multiprocess mode. If you are using
multiprocess mode, this package is not for you.
How It Works
------------
Internally, `prometheus_client` stores values in a class called `_MutexValue`.
As the name suggests, this class is protected by a mutex, and can become a
bottleneck when placed in tight inner loops.
This package monkey patches `prometheus_client` to use its own class,
`_AtomicValue`, which internally uses gcc's `__atomic` operations.
Yes, I know `stdatomic` is more portable, but I've got a requirement to
support gcc 4.8.
Further Work
------------
- Be more portable
- Consider stealing Java 8 `DoubleAdder`'s design, if even more speed is
needed.
- Can multiprocess be done?
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
cPrometheus-0.1.tar.gz
(19.7 kB
view details)
File details
Details for the file cPrometheus-0.1.tar.gz
.
File metadata
- Download URL: cPrometheus-0.1.tar.gz
- Upload date:
- Size: 19.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 74fa41ae191f6e88ef64b479e7bb89f2092b8796d3a3be814ac334fcbf31c098 |
|
MD5 | fff183e58e47eb86e3bb040c8cd38eed |
|
BLAKE2b-256 | b455bdb0de2e1e319a0c66ebf7c52b0ef9f2e2f979d70a7dcb2af551a96093c4 |