Commit 41aa986
Item browser performance improvements (mcmonkeyprojects#908)
* image browser performance improvement - set initial aspect ratio of thumbnails
In most cases, we know the aspect ratio of the image we will be using as
the thumbnail. By setting this aspect ratio when creating the thumbnail
element, we can avoid the reflow that occurs when the image loads.
In my test where I click Refresh while viewing folder c (in the a/b/c tree)
where c has 635 files and I have the profiler running (which slows things down)
this reduces the time from click to finish by about 20% (from 8s to 6.5s). With debugger closed, the click-to-finish time is about 5s.
* Avoid repetitive reflow when triggering lazyload elements
* Defer adding title to an item until the mouse enters the item.
Converting HTML to text is expensive, and 99% of the time not needed.
* only set scrollOffset if the user had been scrolled.
* Optimize the fetching and updating during initial load and on refresh.
* Only render the files once after the folder tree has been fetched and expanded (original code was rendering files each fetch...so could be many many times)
* Only fetch the folders/files once if refreshing the root folder (original code was fetching 2x)
* Only fetch the folders/files twice if refreshing a subfolder (original code was fetching (1 + 1 * subfolderDepth).
* clean and simplify
* remove stray css edits
---------
Co-authored-by: Alex "mcmonkey" Goodwin <[email protected]>1 parent abfa807 commit 41aa986
File tree
3 files changed
+43
-20
lines changed- src/wwwroot
- css
- js/genpage
- gentab
- helpers
3 files changed
+43
-20
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
366 | 366 | | |
367 | 367 | | |
368 | 368 | | |
| 369 | + | |
| 370 | + | |
369 | 371 | | |
370 | 372 | | |
371 | 373 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
149 | 149 | | |
150 | 150 | | |
151 | 151 | | |
152 | | - | |
| 152 | + | |
| 153 | + | |
153 | 154 | | |
154 | 155 | | |
155 | 156 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
9 | | - | |
10 | | - | |
11 | | - | |
12 | | - | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| |||
95 | 95 | | |
96 | 96 | | |
97 | 97 | | |
| 98 | + | |
98 | 99 | | |
99 | 100 | | |
100 | 101 | | |
| |||
142 | 143 | | |
143 | 144 | | |
144 | 145 | | |
| 146 | + | |
145 | 147 | | |
146 | 148 | | |
147 | 149 | | |
| |||
150 | 152 | | |
151 | 153 | | |
152 | 154 | | |
| 155 | + | |
| 156 | + | |
153 | 157 | | |
154 | 158 | | |
155 | 159 | | |
| |||
158 | 162 | | |
159 | 163 | | |
160 | 164 | | |
| 165 | + | |
| 166 | + | |
161 | 167 | | |
162 | 168 | | |
163 | 169 | | |
| |||
168 | 174 | | |
169 | 175 | | |
170 | 176 | | |
| 177 | + | |
| 178 | + | |
171 | 179 | | |
172 | 180 | | |
173 | 181 | | |
| |||
177 | 185 | | |
178 | 186 | | |
179 | 187 | | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
180 | 191 | | |
181 | 192 | | |
182 | 193 | | |
| |||
326 | 337 | | |
327 | 338 | | |
328 | 339 | | |
329 | | - | |
| 340 | + | |
330 | 341 | | |
331 | 342 | | |
332 | 343 | | |
| |||
431 | 442 | | |
432 | 443 | | |
433 | 444 | | |
434 | | - | |
435 | | - | |
436 | | - | |
437 | | - | |
438 | | - | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
439 | 455 | | |
440 | 456 | | |
441 | 457 | | |
| |||
486 | 502 | | |
487 | 503 | | |
488 | 504 | | |
489 | | - | |
| 505 | + | |
490 | 506 | | |
491 | 507 | | |
492 | 508 | | |
| |||
717 | 733 | | |
718 | 734 | | |
719 | 735 | | |
720 | | - | |
721 | | - | |
722 | | - | |
723 | | - | |
724 | | - | |
725 | | - | |
726 | 736 | | |
727 | | - | |
| 737 | + | |
| 738 | + | |
| 739 | + | |
| 740 | + | |
| 741 | + | |
| 742 | + | |
| 743 | + | |
| 744 | + | |
| 745 | + | |
| 746 | + | |
| 747 | + | |
728 | 748 | | |
729 | 749 | | |
730 | 750 | | |
| |||
0 commit comments