oracletrace icon indicating copy to clipboard operation
oracletrace copied to clipboard

[Bug]: Compare silently skips entries when old_time == 0

Open KaykCaputo opened this issue 7 months ago • 2 comments

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

KaykCaputo avatar Apr 17 '26 12:04 KaykCaputo

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.

waldo121 avatar Apr 21 '26 15:04 waldo121

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 == 0 and new_time > 0 → "no baseline" (newly measurable)
  • old_time == 0 and new_time == 0 → "no signal"

This avoids division by zero while keeping the result visible and understandable.

KaykCaputo avatar Apr 22 '26 14:04 KaykCaputo