Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
scrooge-generator: cache getCanonicalPath value in DirImporter
Problem Using a large number of `DirImporter` instances within a `MultiImporter` is very slow. This is because `DirImporter` uses `java.io.File.getCanonicalPath` as part of it's `equals()` and `hashCode()` methods, which are called frequently from `MultiImporter`, esp. in `MultiImporter.deduped()`. `File.getCanonicalPath` makes system IO calls, and is relatively slow because of it. Solution Updates `DirImporter` to cache the result of `getCanonicalPath` so it's only called once. JIRA Issues: AIPIPE-7239 Differential Revision: https://phabricator.twitter.biz/D523368
- Loading branch information