Giter Club home page Giter Club logo

Comments (7)

CodeF53 avatar CodeF53 commented on July 27, 2024 2

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.

CodeF53 avatar CodeF53 commented on July 27, 2024 2

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.

jamsinclair avatar jamsinclair commented on July 27, 2024 1

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.

jamsinclair avatar jamsinclair commented on July 27, 2024

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.

jamsinclair avatar jamsinclair commented on July 27, 2024

Also please add alpha optimizations to OptimiseOptions

@CodeF53 feel free to submit a PR and I'll happily accept it.

from jsquash.

jamsinclair avatar jamsinclair commented on July 27, 2024

@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.

jamsinclair avatar jamsinclair commented on July 27, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.