Implementation of intern table for line/branch objects

#131 Declined
Repository
coverage.py
Branch
default
Repository
coverage.py
Branch
default
Author
  1. David MacIver
Reviewers
Description

This creates a customized C level hash map that maps uint64_t keys to Python objects. This can be used to avoid the slow path of allocating Python tuples (and to a lesser extent Python integers) when tracing lines.

This is likely to help a fair bit for loop-heavy code - in my experiments code which just involved a long-running loop, the overhead for measuring branch coverage dropped from about 50% to about 5% (line coverage was consistently in the 5-10% range, so this brought branch coverage tracking to a comparable level of overhead to line coverage).

Comments (1)