Giter Club home page Giter Club logo

Comments (4)

etemesi254 avatar etemesi254 commented on August 26, 2024

Hello, sorry for a late reply

Apparently Github doesn't send emails any more

Let me look into it

from zune-jpeg.

etemesi254 avatar etemesi254 commented on August 26, 2024

Initial findings

This is an interesting case.

Benchmarks on my machine
Amd Ryzen 4500U

lib time
zune-jpeg 0.595 ms
libjpeg-turbo 0.446 ms
jpeg-decoder 0.610 ms

And the function i.e decode_mcu_block is heavily optimized.

The issue I think is that

  1. The image is quite detailed, it means we have to deal with a lot of data, so short paths the library tries to exploit do not work.

  2. Because these short paths do not work, we end up doing more work than what libjpeg-turbo does, (e.g we do more work in IDCT in hopes that we can exploit that most blocks consist of a row of zeroes).

  3. We have some extra optimizations in decode_mcu_block that may be a pessimization for this type of image, i.e we have one extra branch per decoded value which may be a culprit of branch mispredictions

from zune-jpeg.

etemesi254 avatar etemesi254 commented on August 26, 2024

After checking on this, the issue is that optimizations that work in other images become pessimizations for this particular image.

Due to the nature of this image, it remains an edge case and I do not see any issue in giving it a high priority.

But I would still like to add it to the benchmark samples to see if maybe I might optimize the library to handle such cases.

Closing this due to the above reasons, Feel free to open it if any need arises

from zune-jpeg.

etemesi254 avatar etemesi254 commented on August 26, 2024

High memory usage is the culprit.

Re-opening this

from zune-jpeg.

Related Issues (18)

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.