Mercurial > jhg
comparison design.txt @ 200:114c9fe7b643
Performance optimization: reduce memory ParentWalker hogs
author | Artem Tikhomirov <tikhomirov.artem@gmail.com> |
---|---|
date | Wed, 20 Apr 2011 21:14:51 +0200 |
parents | 33a7d76f067b |
children | 706bcc7cfee4 |
comparison
equal
deleted
inserted
replaced
199:f4fa4456fa50 | 200:114c9fe7b643 |
---|---|
101 | 101 |
102 IndexEntry(int offset, int baseRevision) got replaced with int[] arrays (offsets - optional) | 102 IndexEntry(int offset, int baseRevision) got replaced with int[] arrays (offsets - optional) |
103 for 69338 revisions from cpython repo 1109408 bytes reduced to 277368 bytes with the new int[] version. | 103 for 69338 revisions from cpython repo 1109408 bytes reduced to 277368 bytes with the new int[] version. |
104 I.e. total for changelog+manifest is 1,5 Mb+ gain | 104 I.e. total for changelog+manifest is 1,5 Mb+ gain |
105 | 105 |
106 ParentWalker got arrays (Nodeid[] and int[]) instead of HashMap/LinkedHashSet. This change saves, per revision: | |
107 was: LinkedHashSet$Entry:32 + HashMap$Entry:24 + HashMap.entries[]:4 (in fact, up to 8, given entries size is power of 2, and 69000+ | |
108 elements in cpython test repo resulted in entries[131072]. | |
109 total: (2 HashMaps) 32+(24+4)*2 = 88 bytes | |
110 now: Nodeid[]:4 , int[]:4 bytes per entry. arrays of exact revlog size | |
111 total: (4 Nodeid[], 1 int[]) 4*4 + 4 = 20 bytes | |
112 for cpython test repo with 69338 revisions, 1 387 224 instead of 4 931 512 bytes. Mem usage (TaskManager) ~50 Mb when 10000 revs read | |
113 | |
106 <<<<< | 114 <<<<< |
107 | 115 |
108 Tests: | 116 Tests: |
109 DataAccess - readBytes(length > memBufferSize, length*2 > memBufferSize) - to check impl is capable to read huge chunks of data, regardless of own buffer size | 117 DataAccess - readBytes(length > memBufferSize, length*2 > memBufferSize) - to check impl is capable to read huge chunks of data, regardless of own buffer size |
110 | 118 |