Closed shazow closed 2 weeks ago
This increases the bundle 15.34 kb -> 23.61 kb (54%). Pretty substantialy, need to decide if it's worth it.
Before:
lib.esm/index.js
Size limit: 20 kB
Size: 15.34 kB with all dependencies, minified and gzipped
lib.cjs/index.js
Size limit: 165 kB
Size: 163.64 kB with all dependencies, minified and gzipped
After:
lib.esm/index.js
Package size limit has exceeded by 3.62 kB
Size limit: 20 kB
Size: 23.61 kB with all dependencies, minified and gzipped
lib.cjs/index.js
Package size limit has exceeded by 24.09 kB
Size limit: 165 kB
Size: 189.09 kB with all dependencies, minified and gzipped
@jxom Am I doing anything obviously wrong here?
Try import from ox/*
instead of the root namespace. E.g. import * as Abi from ‘ox/Abi’
, etc. Let me know if that doesn’t work and I can have a deeper look.
@jxom Updated in 4be0a081260b37fe419b87eb7d506f4a6e39d9b1, cjs bundle is smaller now, but esm is still roughly the same.
lib.esm/index.js
Package size limit has exceeded by 3.18 kB
Size limit: 20 kB
Size: 23.18 kB with all dependencies, minified and gzipped
lib.cjs/index.js
Size limit: 165 kB
Size: 31.43 kB with all dependencies, minified and gzipped
Ah, found the culprit. Looks like these guys are affecting the tree-shaking process. Going to refactor things a bit to fix.
Thanks for investigating 🙏
lib.esm/index.js
Size limit: 20 kB
Size: 14.04 kB with all dependencies, minified and gzipped
lib.cjs/index.js
Size limit: 165 kB
Size: 31.36 kB with all dependencies, minified and gzipped
wooo, releasing new version now
Can you try update to ox@0.2.0
?
Seems reasonably faster too.
✓ src/selectors.bench.ts (2) 1218ms
✓ (2) 1216ms
name hz min max mean p75 p99 p995 p999 rme samples
· selectorsFromBytecode (ox) 2,273.48 0.3985 1.3748 0.4399 0.4401 0.6035 0.7232 1.0234 ±0.68% 1137 fastest
· selectorsFromBytecode (ethers) 898.17 1.0256 1.6729 1.1134 1.1266 1.3229 1.3568 1.6729 ±0.45% 450
BENCH Summary
selectorsFromBytecode (ox) - src/selectors.bench.ts >
2.53x faster than selectorsFromBytecode (ethers)
Looking much better, thank you!
lib.esm/index.js
Size limit: 20 kB
Size: 13.87 kB with all dependencies, minified and gzipped
lib.cjs/index.js
Size limit: 165 kB
Size: 31.15 kB with all dependencies, minified and gzipped
Closes #151