$ for f in *.js; do echo $f - $(gzip $f -c | wc -c); done
example.js - 178
without-0.js - 173
without-1.js - 172
without-01.js - 170We have four nearly identical code blocks at indexes 0, 1, 2, 3.
The experiment:
- All:
178bytes - Without 0:
173bytes. Theoretically, 0 is5bytes - Without 1:
172bytes. Theoretically, 0 is6bytes - Without 0 and 1:
170bytes. Together, the actual removal reduces the total bundle by8bytes, which is less than5 + 6 = 11individually.