
Product
Secure Your AI-Generated Code with Socket MCP
Socket MCP brings real-time security checks to AI-generated code, helping developers catch risky dependencies before they enter the codebase.
Sharing memory based Hash Table extension for Python
For examples, see test cases in python files (pyshmht/Cacher.py, pyshmht/HashTable.py), where you can find performance tests as well.
capacity=200M, 64 bytes key/value tests, tested on (Xeon E5-2670 0 @ 2.60GHz, 128GB ram)
malloc
ed memory)set: 0.93 Million iops;
get: 2.35 Million iops;
set: 451k iops;
get: 272k iops;
set: 354k iops;
get: 202k iops;
set: 501k iops (cached), 228k iops (after write_back);
get: 560k iops (cached), 238k iops (no cache);
set: 741k iops;
get: 390k iops;
In hashtable.c, default max key length is 256 - 4
, max value length is 1024 - 4
; you can change bucket_size
and max_key_size
manually, but bear in mind that increasing these two arguments will result in larger memory consumption.
If you find any bugs, please submit an issue or send me a pull request, I'll see to it ASAP :)
p.s. hashtable.c
is independent (i.e. has nothing to do with python), you can use it in other projects if needed. :P
FAQs
provide shared memory based hash table for python
We found that pyshmht demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Socket MCP brings real-time security checks to AI-generated code, helping developers catch risky dependencies before they enter the codebase.
Security News
As vulnerability data bottlenecks grow, the federal government is formally investigating NIST’s handling of the National Vulnerability Database.
Research
Security News
Socket’s Threat Research Team has uncovered 60 npm packages using post-install scripts to silently exfiltrate hostnames, IP addresses, DNS servers, and user directories to a Discord-controlled endpoint.