Because the number of grafts is low, I always thought we would implement grafts in RevWalk by just having the RevWalk's graft enable method lookup each of the RevCommits named as keys in the graft file, and assign their parents outright to the looked up RevCommit parents.

That way during traversal we aren't incurring this hit to look to see if each individual commit is part of the grafts file, its already been computed.  And actually that is part of the reason why we have this "if (parents == null)" test in parseCanonical.  We don't want to replace parents that have already been computed for us, even if they are currently different from what is in the real content we loaded.