Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
DirectApkSoSource: optimize ZipEntry lookup
Summary: DirectApkSoSource.loadLibrary() has quadratic behavior: for every library it loads (either directly or as a dependency), it iterates over ZipFile entries to find a match. This patch replaces the linear search with ZipFile#getEntry. This results in an ~8x startup improvement in a large app that loads ~1k shared libraries. This can be optimized further if needed, by potentially trading some memory (reusing open ZipFile objects) or doing more work up front (computing all the dependencies on startup) for faster lookups. Reviewed By: simpleton Differential Revision: D54651944 fbshipit-source-id: 5d0fc8fb31decfc3bd246a7c02a342c25a5f9427
- Loading branch information