Comments (7)
It works!
Dataset & Settings
PackXBR Nuxt
Vanilla 1.20 items folder
- xBRZ 4x
- 14 threads
Data
Src - 208,896 bytes
No Opt - 1,155,072 bytes
Old - 3645ms - 626,688 bytes
Next - 2981ms - 634,880 bytes
New (alpha opt) - 2334ms - 577,536 bytes
Conclusions
Data to be taken with a grain of salt, as it varies a lot for small tests
Going to run a larger test to get better ideas in terms of how things average out in my use case
from jsquash.
Dataset & Settings
PackXBR Nuxt
Faithful 32x - 1.19.4
- xBRZ 2x
- 8 threads
Data
Src - 9,052,160 bytes
No Opt - 39,489,536 bytes
Old - 209296ms - 23,101,440 bytes
New - 57092ms - 23,056,384 bytes
New (alpha opt) - 55698ms - 21,737,472 bytes
Conclusions
Despite the clear margin of error (run with alpha optimizations being ~2000ms faster), its clear that the new release is atleast 3x faster for this type of dataset.
In terms of size:
- without alpha optimizations, ~0.1% smaller
- with alpha optimizations, ~6% smaller
from jsquash.
I've created a draft of this upgrade in #30. It also includes the optimiseAlpha
option (defaults to false
).
In the interim I've published some pre-release versions. You can install them with
npm i -S @jsquash/oxipng@next
npm i -S @jsquash/oxipng@next-single-thread-only
(Use this version if you still have issues with Vue/Nuxt)
If you have time to spare @CodeF53 it would be great if you can help validate these upgrades work for you. Thanks! 🙇
from jsquash.
Thanks for the suggestion @CodeF53. I can look into it but I'm not a codec expert so if it takes too long, I'll leave it as is. I'd welcome contributions from yourself or others if you'd like to update it.
As noted in the README, the codecs and code is almost identically copied from https://github.com/GoogleChromeLabs/squoosh, the only difference being we repackage them as web modules. The upstream repo has also not been updated in 2 years – https://github.com/GoogleChromeLabs/squoosh/tree/dev/codecs/oxipng. You could suggest upstream that they update it and then this repo can benefit from their updates.
from jsquash.
Also please add alpha optimizations to OptimiseOptions
@CodeF53 feel free to submit a PR and I'll happily accept it.
from jsquash.
@CodeF53 thanks for the thorough testing, glad to see it seems to be working well 🤩
I'll look at publishing the official version from #30 and note the perf. improvements. Many thanks! 🙇
from jsquash.
I've published v2.0.0 that should contain the changes from #30.
If you still need a single thread only build, please install with npm i -S @jsquash/oxipng@next-single-thread-only
. I plan to create a more general solution for all threaded modules in the near future (#33)
I'll mark this as resolved.
from jsquash.
Related Issues (20)
- Oxipng multi-threaded mode fails when run from main thread.
- Export single thread only methods for codecs that have multi-threading. HOT 1
- Doesn't work in Vite SSR HOT 5
- Simple CDN example HOT 5
- Cannot find module in sveltekit project HOT 6
- Issues with multi-threaded worker modules and Vite HOT 13
- Basic Node.js Support HOT 1
- Provide way to override WASM file location HOT 2
- Deno fails with "NotSupported: Classic workers are not supported." HOT 1
- Improve @jquash/avif decode speed HOT 6
- @jsquash/png fails to decode some images HOT 14
- Create a reference decode speed benchmark page HOT 1
- Module not found HOT 1
- gif support? HOT 1
- Add type declarations for all wasm files? HOT 5
- jpeg and webp fail to import inside web worker HOT 2
- Resize component memory leak HOT 7
- Nuxt build error: UMD and IIFE output formats are not supported for code-splitting builds. HOT 4
- Passing a custom fetch function
- background execution? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jsquash.