Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Ever wonder why software is so slow...?

Name: Cudder !cXCudderUE 2017-09-04 4:18

Because it's all written by retards.

https://github.com/ArtifexSoftware/jbig2dec/blob/master/jbig2_image.c

Scroll down to jbig2_image_compose_unopt()... and then facepalm. It doesn't take a genius to realise that twiddling an image pixel-by-pixel is going to be dead slow.

Name: Anonymous 2017-09-04 7:07

case JBIG2_COMPOSE_OR:
for (j = 0; j < sh; j++) {
for (i = 0; i < sw; i++) {
jbig2_image_set_pixel(dst, i + x, j + y, jbig2_image_get_pixel(src, i + sx, j + sy) | jbig2_image_get_pixel(dst, i + x, j + y));
}
}
break;

...etc...

...this part? Is this image format supposed to be 1-bit color only? Then yes, it is bad code but not for this piece of code but for choosing the wrong data structure(s) in the first place.
But really I'm not surprised: this is printer-related enterprise stuff. This will always be somewhat inefficient because they can afford to be inefficient with this stuff. Compare to e.g. video games where programmers will squeeze out anything they have out of their target machines.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List