]> git.draconx.ca Git - liblbx.git/commit
lbximg: Improve performance of PAM output.
authorNick Bowler <nbowler@draconx.ca>
Wed, 22 Sep 2021 05:24:25 +0000 (01:24 -0400)
committerNick Bowler <nbowler@draconx.ca>
Wed, 22 Sep 2021 05:24:25 +0000 (01:24 -0400)
commit395b742050af148137758f1d4492a3922569fb91
treeaab26bac356b12feb355d525e464df92b2d42cb7
parentdd472b62830e4d349169778d1f8ae4e985d78953
lbximg: Improve performance of PAM output.

The PAM output currently calls fwrite for every pixel, which amounts to
about half a million fwrite calls to output a full screen image.  For a
fullscreen animation like logo.lbx.001, the majority of the execution
time is spent in fwrite.

Let's reduce this a lot by formatting and outputting an entire row at
a time, which almost completely eliminates fwrite from the profile.
src/pnm.c