MCPcopy Create free account
hub / github.com/cameron314/concurrentqueue / do_extract

Function do_extract

benchmarks/extract_graph_data.py:16–27  ·  view source on GitHub ↗
(bench, queue_header)

Source from the content-addressed store, hash-verified

14 # data = { thread_count: [ locked, boost, tbb, moodycamel, moodycamel_tok, moodycamel_bulk ], ... }
15
16 def do_extract(bench, queue_header):
17 block = re.search(r'^' + bench + r':.*?' + queue_header + r'\s*(.*?)\s*^\s*Operations per second', log, re.S | re.M | re.I).group(1)
18 for threads, opsst in re.findall(r'^\s*(\d+)\s+thread.*?([0-9\.]+[kMG]?\s*$)', block, re.M | re.I):
19 threads = int(threads)
20 multiplier = 1
21 if opsst[-1] in 'kMG':
22 multiplier = { 'k': 1000, 'M': 1000000, 'G': 1000000000 }[opsst[-1]]
23 opsst = opsst[:-1]
24 opsst = int(float(opsst) * multiplier)
25 if threads not in data:
26 data[threads] = []
27 data[threads].append(opsst)
28
29 do_extract(bench, 'LockBasedQueue')
30 do_extract(bench, 'boost::lockfree::queue')

Callers 1

extractFunction · 0.85

Calls 1

groupMethod · 0.80

Tested by

no test coverage detected