Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Cache packageName to base Uri mapping.
This makes analysis with using incremental analysis cache 30% faster. Without this change getBase() takes 40% (!) of total analysis time. With this change - just 0.79% of total time. Although the remaining 17% of PackagesBase.resolve() make my cry. Why URI manipulations are SO SLOW?! R=brianwilkerson@google.com, pquitslund@google.com, kevmoo@google.com BUG= Review URL: https://codereview.chromium.org/2041103005 .
- Loading branch information
71ec483
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
URL manipulation is slow in part because it's a implementing the RFC 3986 resolution algorithm which isn't exactly designed for speed. Most path resolutions won't need the full generality, and I want to see if we can do something faster for the simple cases.
And in part because we have only one implementation which does a lot of string manipulation and copying. - we should have a special-case version for URIs that don't need any normalization and where we can just store the original string passed to
Uri.parse
.So, basically, because we make too many intermediate strings.
71ec483
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, that's what I thought.
We had to add
FastUri
implementation intoanalyzer
.This allowed us to make analysis much faster,
25%
at that time.