Skip to content

Commit 9769739

Browse files
committed
add: memory usage comparison in comment.
1 parent 015ba59 commit 9769739

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

dfc/src/main/java/com/lazygeniouz/dfc/resolver/ResolverCompat.kt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,10 @@ internal object ResolverCompat {
115115
/**
116116
* Pre-sizing the list to avoid resizing overhead.
117117
* This is especially beneficial for directories with a large number of files.
118+
*
119+
* Memory comparison for 8192 files:
120+
* 1. With pre-sizing: 3.10 MB
121+
* 2. Without pre-sizing: 9.60 MB
118122
*/
119123
if (itemCount > 10) listOfDocuments.ensureCapacity(itemCount)
120124

0 commit comments

Comments
 (0)