This is an archive of the discontinued LLVM Phabricator instance.

Small optimizations for SourceManager::getFileID()
Needs ReviewPublic

Authored by djasper on Jan 2 2017, 2:52 PM.

Details

Reviewers
rsmith
Summary

Specifically:

  • Separate one-entry cache for loaded and local files
  • Use bound that can be deduced from that cache for LessIndex
  • Address FIXME to use a faster alternative to isOffsetInFileID()

No functional changes intended.

Diff Detail

Event Timeline

djasper updated this revision to Diff 82819.Jan 2 2017, 2:52 PM
djasper retitled this revision from to Small optimizations for SourceManager::getFileID().
djasper updated this object.
djasper added a reviewer: rsmith.
djasper added a subscriber: cfe-commits.
bruno added a subscriber: bruno.Mar 6 2017, 2:43 PM

Hi Daniel,

This seems pretty nice. Can you share how much performance improvements you got by this / how did you test it?

alexander-shaposhnikov added inline comments.
lib/Basic/SourceManager.cpp
843

not particularly important (and unrelated to your changes) - nit - s /C-style cast / static_cast / ?