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.

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

>>2
big company
Appeal To WTF!?!?!?

Name: Anonymous 2017-09-04 5:54

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

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.

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

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

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

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

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

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

>>11
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:
int
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

>>12
shutup

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

>>15
Addition gets implemented just fine without recursively taking successors.

Name: Anonymous 2017-09-04 22:03

>>16
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) {
case JBIG2_COMPOSE_OR:
?

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

Name: Anonymous 2017-09-05 5:06

>>15
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:
case JBIG2_COMPOSE_OR:
#pragma omp parallel for
for (j = 0; j < h; j++) {
long i;
for (i = 0; i < w / 32; i++) {
dst[...] |= src[...];
}
}
break;


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

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

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

>>15-19
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

>>24
what?

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

Here: https://pastebin.com/Qaj6cmsj


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

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

Name: Anonymous 2017-09-06 19:46

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

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

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

Name: Anonymous 2017-09-07 6:10

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

dubs

Name: Anonymous 2017-09-07 20:22

>>33
nice dubs m8

Name: Anonymous 2017-09-08 1:34

>>23
at the moment there's plenty of more important stuff to work on.
like?

Name: Anonymous 2017-09-08 1:36

>>35
The disassembler.

Name: Anonymous 2017-09-08 1:43

What if I prefer foxit?

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

>>31,32
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:

https://archive.org/download/TheVoynichManuscript/Voynich_Manuscript.pdf

This is JPEG2000+JBIG2:

https://archive.org/download/hydraulicelevato00baxtrich/hydraulicelevato00baxtrich.pdf

Name: Anonymous 2017-09-08 6:56

>>36
I'll believe it when I see it

>>32,38
didn't expect /prague/ to know trasmetropolitan. or voynich manuscript. pleasantly surprised

Name: Anonymous 2017-09-08 21:46

>>39
voynich manuscript
How is this impressive?

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

>>39,40
I just browsed the site for some popular and large image-ful PDFs.

Name: Anonymous 2017-09-09 1:08

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

Name: Anonymous 2017-09-09 1:39

>>42
Complaining is easier.

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

>>42 see >>26

Name: Anonymous 2017-09-09 22:37

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

Name: Anonymous 2017-09-10 2:14

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

Name: Anonymous 2017-09-10 19:03

>>46
What does that have to do with my question?

Name: Anonymous 2017-09-10 22:42

>>47
Learn to think.

Name: Anonymous 2017-09-11 3:02

>>48
_>

Name: Anonymous 2017-09-11 18:44

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

>>50
The disassembler

Name: Anonymous 2017-09-12 6:31

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

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

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

Name: Anonymous 2017-09-13 6:25

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

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

Name: Anonymous 2017-09-15 23:05

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

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