[Bug]: Compare silently skips entries when old_time == 0
Summary
Comparison silently skips cases where old_time == 0, hiding changes and confusing users.
Expected Behavior
Entries where old_time == 0 should not be silently dropped. They should be classified or explicitly marked (and behavior documented).
Actual Behavior
Entries are skipped without explanation.
Proposed Solution
- Decide and implement a policy for
old_time == 0 - Surface a clear marker/category instead of skipping
- Add unit tests for this edge case
Acceptance Criteria
- No silent drops when
old_time == 0 - Output clearly indicates how those cases are handled
- Unit test added
Affected Files
oracletrace/compare.py
Is there a real use case for old_time == 0?
Unless call_count == 0 which means the function is not present in the baseline I don't know how it can happen.
You're right — silently skipping old_time == 0 hides information and makes the output confusing.
This case can happen (e.g. very fast functions below timer resolution), so it shouldn't be treated as “nothing changed”.
Instead of skipping, we should classify it explicitly since percentage comparison is undefined:
old_time == 0andnew_time > 0→ "no baseline" (newly measurable)old_time == 0andnew_time == 0→ "no signal"
This avoids division by zero while keeping the result visible and understandable.