-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Reduce memory footprint during archive scan
When scanning an archive for files a linked list it created with all files and properties before being processed by file system functions such as readdir. This cause some memory overhead since a lot of data is required to be kept resident for a longer period of time. Since the lifetime of the data collected is relatively short there is not need to pre-fetch all information like this. Instead handle file by file and use only a single temporary object to hold whatever meta data is necessary. The performance is also expected to be improved by a change like this since less dynamic heap allocations are required but it also results in a loop unwind that will increase number of functions calls. Measurements of some common use-cases indicated a performance increase of approximately 15%-20% but there are also reports of no improvement at all or even the opposite. The latter should however be considered a rare and exceptional case. This change was triggered by issue #122 for which a very huge archive was mounted with more than 100k files. Signed-off-by: Hans Beckerus <hans.beckerus at gmail.com>
- Loading branch information
Hans Beckerus
committed
Nov 30, 2019
1 parent
2bc97d5
commit 4bc904f
Showing
3 changed files
with
174 additions
and
197 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.