Skip to content

Commit 93c9d2e

Browse files
committed
fixing bug
1 parent d4e9510 commit 93c9d2e

1 file changed

Lines changed: 4 additions & 13 deletions

File tree

microbiorust-py/benchmarks/bench_pipeline.py

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -84,33 +84,24 @@ def track_energy(self, engine, context):
8484
energy_kwh = getattr(tracker, "total_energy", 0)
8585
# Store energy per engine in Joules
8686
return (energy_kwh * 3_600_000)/iterations # Joules/iterations
87+
track_energy.unit = "J"
8788

8889
# --- 1. PRIMARY TIME BENCHMARK (ASV automatic) ---
8990
def time_process_all(self, engine, context):
9091
"""Measures parsing speed (seconds)."""
91-
self._run_logic(engine, context)
92+
self._run_once(engine, context)
9293

9394
# --- 2. PEAK MEMORY BENCHMARK ---
9495
def peakmem_process_all(self, engine, context):
9596
"""Measures maximum resident set size (RAM)."""
96-
self._run_logic(engine, context)
97+
self._run_once(engine, context)
9798

9899
# --- 3. PARSING LATENCY (single-pass) ---
99100
def track_parsing_latency(self, engine, context):
100101
"""Records single-pass parsing latency (seconds)."""
101102
start = time.perf_counter()
102-
self._run_logic(engine, context)
103+
self._run_once(engine, context)
103104
end = time.perf_counter()
104105
return end - start
105106
track_parsing_latency.unit = "s"
106107

107-
# --- 4. ENERGY BENCHMARK ---
108-
def track_energy(self, engine, context):
109-
"""
110-
Returns energy consumed (Joules) for this engine/context using CodeCarbon.
111-
ASV can plot Rust vs Python separately.
112-
"""
113-
self._run_logic(engine, context)
114-
return self._energy_joules[f"{engine}_{context}"]
115-
track_energy.unit = "J"
116-

0 commit comments

Comments
 (0)