Git Product home page Git Product logo

Comments (8)

eustas avatar eustas commented on May 5, 2024

It is quite possible to parallelise the most CPU consuming parts of encoding without changing the format. Unfortunately, same trick would not work for decoder (because of long calculation dependency chains).
We have experimental "groups" encoding that splits image into 256x256 px pieces and processes them in parallel. This allows 3x speedup. Hopefully, we will publish it soon.

Could you please elaborate how much is "much slow than lepton"?

from brunsli.

mychaow avatar mychaow commented on May 5, 2024

Thanks for reply. In my tests, Brunsli is faster than lepton within single-thread, about 2x, but Brunsli's decompression is slower than lepton with multithread, about 3x~4.7x, so if brunsli could support multithread, it's support to be faster than lepton.

It's pleasure to see Brunsli support multithread compress/decompress soon.

Lepton' code is in https://github.com/dropbox/lepton.

from brunsli.

mychaow avatar mychaow commented on May 5, 2024

BTW, What does the follow sentence means?

We have experimental "groups" encoding that splits image into 256x256 px pieces and processes them in parallel. This allows 3x speedup. Hopefully, we will publish it soon.

It's encoded within multithread or SIMD? If it's multithread, it should be faster in proportion to the number of threads, such as 4 threads, it will allows 4x speedup.

from brunsli.

eustas avatar eustas commented on May 5, 2024

PR #48 contains experimental / POC mode that allows parallel encoding / decoding.
This does not include parallel JPEG serialization / deserialization, so that could be a bottleneck.
Give it a try, to see if it improves the situation.

Warning: "groups" file format is not compatible with vanilla Brunsli.

from brunsli.

mychaow avatar mychaow commented on May 5, 2024

Thanks for reply.

I have tested the "groups" encode/decode, default version allows 2x speedup. After changing the threadpool from 4 to 8 threads, it allows 3x speedup. Within 8 threads, "groups" encode/decode is faster than lepton in encode, about 1.4x, but decode is slower than lepton, about 10%.
Looking forward to seeing further optimization.

It's pleasure to see the "groups" encode/decode so soon. Thank you!

from brunsli.

eustas avatar eustas commented on May 5, 2024

As I've mentioned before - serialisation of JPEG is single threaded. This could be parallelised, if "reset interval" has proper value.
Unfortunately, out of 100k random internet JPEGs only 30k has it set...

from brunsli.

eustas avatar eustas commented on May 5, 2024

(PS: if byte-wise JPEG reconstruction is a non-goal, "reset interval" could be set during encoding).

from brunsli.

mychaow avatar mychaow commented on May 5, 2024

ahaha, "groups" encode/decode's speed is acceptable.

from brunsli.

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.