Return Styles: Pseud0ch, Terminal, Valhalla, Blue Moon.

Pages: 1-4041-

Ever wonder why software is so slow...?

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

Because it's all written by retards.

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 4:24

Copyright (C) 2001-2012 Artifex Software, Inc.
I'm sure a big company knows what they're doing.

Name: Cudder !cXCudderUE 2017-09-04 5:52

big company
Appeal To WTF!?!?!?

Name: Anonymous 2017-09-04 5:54

they pay their programmers big money
unlike hobbyists who just do it with little concern

Name: Anonymous 2017-09-04 6:36

retards producing slow software are still a step above retards not producing software. Cudder is all talk and no action!

Name: Anonymous 2017-09-04 7:07

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));


...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.

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

Actually I just finished optimising it with MMX, and got a good ~2x performance improvement overall.

It's also being used as part of a PDF renderer. I was wondering why large PDFs were taking so long to render, did a little profiling and found that little bastard.

Name: Anonymous 2017-09-04 9:03

are you going to submit those changes to some open source library so that everyone can benefit or are you going to claim that you improved everything, submit nothing, show no proof and shitpost on /prog/ about how better you are compared to everyone else? I guess it's going to be the latter.

how's your browser?

Name: Anonymous 2017-09-04 9:40

Well that's fine. So what if they take 2 more seconds to load? It doesn't inconvenience the majority of users

Name: Anonymous 2017-09-04 13:07

Rocket fast renderer
There is no faster PDF renderer than MuPDF. Benchmark tests demonstrate our speed. Learn more.

So you're going to claim that the fastest PDF renderer in existence isn't fast enough. Benchmark tests even demonstrate their speed. I'm not buying into your lies.

Name: Anonymous 2017-09-04 15:24

jbig2_image_compose_unopt() is, as the name suggests, the UNOPTIMIZED version.

Shouldn't you be looking at jbig2_image_compose()? Let's get an analysis of that one

Name: Anonymous 2017-09-04 16:47

jbig2_image_compose_unopt() is, as the name suggests, the UNOPTIMIZED version.
Nice shitpost.

Also that doesn't matter as it's still being called:
jbig2_image_compose(Jbig2Ctx *ctx, Jbig2Image *dst, Jbig2Image *src, int x, int y, Jbig2ComposeOp op)

if (op != JBIG2_COMPOSE_OR) {
/* hand off the the general routine */
return jbig2_image_compose_unopt(ctx, dst, src, x, y, op);


Name: Anonymous 2017-09-04 19:39

People who only know C and C-based languages don't understand arrays. People who don't understand arrays write slow array code.

Name: Anonymous 2017-09-04 20:03


Name: Anonymous 2017-09-04 20:36

How do you twiddle an image pixel by pixel without twiddling an image pixel by pixel?
B = op(A, B) = [op(A0,0,B0,0) .. op(Aw-1,h-1,Bw-1,h-1)]
How do you bypass a definition?

Name: Anonymous 2017-09-04 21:13

Addition gets implemented just fine without recursively taking successors.

Name: Anonymous 2017-09-04 22:03

You still need to access each operand individually, just like this example of accessing pixels individually.

As far as I can tell, you have to loop over the pixels one at a time and pray that your compiler decides to use SIMD instructions.

Name: Anonymous 2017-09-05 1:21

if (op != JBIG2_COMPOSE_OR) {

if (jbig2_image_get_pixel_transparency(src, i + sx, j + sy)>0)

Name: Anonymous 2017-09-05 5:06

I think a graphic shader would do it an order of magnitude faster, provided the hardware has shader support(openGL/OpenCL/GLSL)

Name: Anonymous 2017-09-05 6:36

Step 1:
uint32_t buf[w / 32][h];

Step 2:
#pragma omp parallel for
for (j = 0; j < h; j++) {
long i;
for (i = 0; i < w / 32; i++) {
dst[...] |= src[...];

...hey, I just made it (32*n) times faster, wheres my Nobel Peace Prize?

Name: Anonymous 2017-09-05 6:39

Cudder is all talk and no action!

Name: Anonymous 2017-09-05 7:07

ever wonder why dubs are so slow?

Name: Cudder !cXCudderUE 2017-09-05 10:01

Due to licensing crap I can't, but give me a day or two and I'll write something up on a pastebin which you can try.

Browser is a background thing, at the moment there's plenty of more important stuff to work on.

Try some of the big ebook scans on . MuPDF's vector graphics rendering is fast enough, but it chokes severely on pages with JBIG2/JPEG2000 images.

CPUs can work in far bigger chunks than bits. The partially optimised code (for the OR caes only, how strange) works with bytes, but you can do bigger than that.

Actually it should be possible to replace all that code with a single BitBlt() call, which as far as I know is GPU accelerated, but Windows-only.

Name: Anonymous 2017-09-05 22:46

obviously they made it this way for RAM optimization
not everything is about speed

Name: Anonymous 2017-09-05 22:54


Name: Cudder !cXCudderUE 2017-09-06 9:48


Indeed. Memory usage is the same. I can't imagine all the get/set-pixel function calls are smaller than the bytewise/intwise version either.

Name: Anonymous 2017-09-06 11:27

thanks for not being all talk and no action for once, Cudder! I'll try this out

Name: Anonymous 2017-09-06 19:46

Maybe you should do something that would really make a difference, rather than this stuff.

PDFs loading 3 seconds faster isn't very useful.

Name: Cudder !cXCudderUE 2017-09-07 3:32

Waiting 5 seconds every time you "turn the page" on an ebook means technology has failed. It would be faster to flip through the hardcopy. After the fix, it's at a far more reasonable ~0.5s/page.

Name: Anonymous 2017-09-07 4:22

Hell must be freezing over, but I agree with Cudder for once.

Name: Anonymous 2017-09-07 6:10

This literally never happens
Most of the time is spent at start up

Name: Anonymous 2017-09-07 15:57

Just to confirm, I opened ``Transmetropolitan - I Hate It Here (2000) (c2c).pdf'' for a quick read.
Start up took about 5 or 6 seconds, but after that the pages all loaded instantly even though I scrolled down pretty fast.

Name: Anonymous 2017-09-07 20:17


Name: Anonymous 2017-09-07 20:22

nice dubs m8

Name: Anonymous 2017-09-08 1:34

at the moment there's plenty of more important stuff to work on.

Name: Anonymous 2017-09-08 1:36

The disassembler.

Name: Anonymous 2017-09-08 1:43

What if I prefer foxit?

Name: Cudder !cXCudderUE 2017-09-08 3:07

Can you post a link to that file? I'm almost willing to bet it's not JPEG2000 but regular JPEG or even PNG, both of which are very very fast.

For comparison, this is regular JPEG:

This is JPEG2000+JBIG2:

Name: Anonymous 2017-09-08 6:56

I'll believe it when I see it

didn't expect /prague/ to know trasmetropolitan. or voynich manuscript. pleasantly surprised

Name: Anonymous 2017-09-08 21:46

voynich manuscript
How is this impressive?

Name: Cudder !cXCudderUE 2017-09-09 0:15

I just browsed the site for some popular and large image-ful PDFs.

Name: Anonymous 2017-09-09 1:08

So, why didn't you submit an issue/pull?

Name: Anonymous 2017-09-09 1:39

Complaining is easier.

Name: Cudder !cXCudderUE 2017-09-09 3:14

>>42 see >>26

Name: Anonymous 2017-09-09 22:37

This isn't the repo.
How is this pointing it to their attention?

Name: Anonymous 2017-09-10 2:14

Distributing the binary is probably against several licenses
Learn to read.

Name: Anonymous 2017-09-10 19:03

What does that have to do with my question?

Name: Anonymous 2017-09-10 22:42

Learn to think.

Name: Anonymous 2017-09-11 3:02


Name: Anonymous 2017-09-11 18:44

Now that you've finished this project, cudder-sama, what's the next step of your master plan?

Name: Anonymous 2017-09-12 3:51

The disassembler

Name: Anonymous 2017-09-12 6:31

not impressive, just not something I thought riders would be interested in tbh
with no survivors

Name: Cudder !cXCudderUE 2017-09-12 9:37

It's not really finished. There is none. I have a ton of other stuff to do.

Name: Anonymous 2017-09-13 6:25

What happened to your "1 space per indentation level" style?

Name: Anonymous 2017-09-13 7:07

what happened to your "dubs" style?

Name: Anonymous 2017-09-13 20:58

maybe it's for the better, because that was awful.

Name: Anonymous 2017-09-15 23:05

I remember that. It was the recommended style for anoncoreutils.

Name: Cudder !cXCudderUE 2017-10-24 2:11

Time how long it takes to render each page.

JPEG2000 has impressive compression ratio as well as CPU usage.

Name: Anonymous 2017-10-24 2:40

Maybe 5 seconds with pdf.js

Name: Cudder !cXCudderUE 2017-10-25 10:54

It takes ~2s on 8-year-old hardware after the optimisations discussed in this thread.

It takes closer to 5 seconds without.

Name: Anonymous 2017-10-25 10:55

that's fine, I'm in no rush

Name: Anonymous 2017-10-26 11:33


Actually, you have to set these pixels at some stage. Cudder, you're stupid. And modern software is slow, because it uses garbage collected languages, like Ruby and Python, and useless crap, like utf32 strings, instead of plain ASCII.

Name: Anonymous 2017-10-26 11:35

explain why >>26 is so faster then

Name: Anonymous 2017-10-26 11:35


BTW, old ZX Spectrum and DOS software drawn pixel by pixel, and took minuscule memory and CPU time by modern standards, without any help from GPU.

Name: Anonymous 2017-10-26 11:38


Just avoid using C++, otherwise you calls would go through an endless abstraction chain. Plain C is just faster, especially because it forces you to allocate all resources in advance, without these unpredictable RAII smart pointers.

Name: Anonymous 2017-10-26 14:39

Her patches still worked.

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