Closed mbotsch closed 1 year ago
Who would have guessed. Reading a 138 MB PNG image just to get the size takes 9.3 seconds on my machine. That is rather disappointing ☹️.
Changed the way image size is determined in 84e656c8b8c11eadafe41ad041daab2d16d078b1.
Give it a try.
Doesn't compile on my machine:
/Users/botsch/git/decker/src/Text/Decker/Filter/Media.hs:11:1: error:
Could not load module ‘Conduit’
It is a member of the hidden package ‘conduit-1.3.4.2’.
Perhaps you need to add ‘conduit’ to the build-depends in your .cabal file.
Use -v (or `:set -v` in ghci) to see a list of the files searched for.
|
11 | import Conduit (runConduit, runConduitRes, sourceFile, withSourceFile, (.|))
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
/Users/botsch/git/decker/src/Text/Decker/Filter/Media.hs:13:1: error:
Could not find module ‘Data.Conduit.ImageSize’
Use -v (or `:set -v` in ghci) to see a list of the files searched for.
|
13 | import Data.Conduit.ImageSize (Size (Size, height, width), sinkImageInfo, sinkImageSize)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Anything special I have to do?
Committer zu blöd Error. Pull again.
Much better. Thanks!
Given a high-resolution image
large.jpg
with 2160 × 3840 pixels.This single-slide deck takes 0.3s to compile:
Using line-blocks for image rows, this single-slide deck takes 5.5s to compile:
The line blocks seem to do some computation on the images (detecting width/height?), which are very inefficient, at least on my system (MacOS 12.5, M1 MacBookPro).
@monofon: Is the performance similarly bad on your machine? @salbeira: Can you please test whether it behaves similarly on Linux and Windows?