diff --git a/benchmarks/README.md b/benchmarks/README.md new file mode 100644 index 0000000..c3b4803 --- /dev/null +++ b/benchmarks/README.md @@ -0,0 +1,113 @@ +Load factor: 2/3 +IntCap is powers of two, so steps are at 2/3*(1<5}: ", end='', flush=True) + user_agent_parser.MAX_CACHE_SIZE = cache_size + user_agent_parser._PARSE_CACHE.clear() + start = time.time() + for ua in uas: + user_agent_parser.Parse(ua) + end = time.time() + r = hits / (hits + misses) + t = int(len(uas) / (end - start)) + print(f"hit rate {r:.1%} throughput: {t} ua/s") + hits = misses = 0