Allow mutable object ids, improving commit parsing performance
One of the larger expenses during RevWalk is RevCommit's hidden
parseCanonical method, which spends most of its time parsing the
tree and parent references from hex SHA-1 strings into ObjectIds,
and then mapping them through RevWalk's map. By creating a new
mutable ObjectId variant we can recycle this mutable value and
avoid direct allocation costs. Typically we will parse each of
the SHA-1 values, not find it in the map, and then need to create
a new RevObject instance to reference the object. The mutable
instance as our lookup key saves one object creation.
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
15 files changed: