Thanks for the suggestion. Here are my results (apt helpfully suggested that I install libjpeg-turbo-test):
Ubuntu (Windows Subsystem on Linux):
>>>>> RGB (Top-down)
<--> JPEG 4:2:0 Q80 <<<<<
Image size: 227 x 149
Compress --> Frame rate: 7421.929573 fps
Output image size: 6068 bytes
Compression ratio: 16.721984:1
Throughput: 251.031924 Megapixels/sec
Output bit stream: 360.290149 Megabits/sec
Decompress --> Frame rate: 9198.674991 fps
Throughput: 311.126784 Megapixels/sec
Please test an image that is closer to the actual size you intend to compress in your application. The performance of the 227x149 test image in libjpeg-turbo is going to depend too heavily on overhead to be a good comparison. You want a much larger image so you can really test the maximum throughput.
--
You received this message because you are subscribed to the Google Groups "libjpeg-turbo User Discussion/Support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to libjpeg-turbo-u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/libjpeg-turbo-users/0a9ce63c-c554-0ef0-c472-42ffaff69ba3%40gmail.com.
Ubuntu (WSL):
>>>>> RGB (Top-down)
<--> JPEG 4:2:0 Q80 <<<<<
Image size: 15335 x 7991
Compress --> Frame rate: 2.735202 fps
Output image size: 11710674 bytes
Compression ratio: 31.392382:1
Throughput: 335.177027 Megapixels/sec
Output bit stream: 256.248429 Megabits/sec
Decompress --> Frame rate: 3.473690 fps
Throughput: 425.672917 Megapixels/sec
Windows 10 (x64):
>>>>> RGB (Top-down)
<--> JPEG 4:2:0 Q80 <<<<<
Image size: 15335 x 7991
Compress --> Frame rate: 0.740540 fps
Output image size: 11710674 bytes
Compression ratio: 31.392382:1
Throughput: 90.747236 Megapixels/sec
Output bit stream: 69.377776 Megabits/sec
Decompress --> Frame rate: 1.230370 fps
Throughput: 150.772003 Megapixels/sec
------------------------------------------------------------------
And for good measure, a medium-sized image:
------------------------------------------------------------------
Ubuntu (WSL):
>>>>> RGB (Top-down)
<--> JPEG 4:2:0 Q80 <<<<<
Image size: 1024 x 1024
Compress --> Frame rate: 351.023714 fps
Output image size: 72448 bytes
Compression ratio: 43.420495:1
Throughput: 368.075042 Megapixels/sec
Output bit stream: 203.447728 Megabits/sec
Decompress --> Frame rate: 430.199562 fps
Throughput: 451.096936 Megapixels/sec
Windows 10 (x64):
>>>>> RGB (Top-down)
<--> JPEG 4:2:0 Q80 <<<<<
Image size: 1024 x 1024
Compress --> Frame rate: 101.308824 fps
Output image size: 72448 bytes
Compression ratio: 43.420495:1
Throughput: 106.230002 Megapixels/sec
Output bit stream: 58.716973 Megabits/sec
Decompress --> Frame rate: 150.991629 fps
Throughput: 158.326198 Megapixels/sec
---------------------------------------------------------------------------
OK, so it's a legitimate slow-down, but unfortunately, I have no clue what could be causing it. When I run Windows vs. Linux on the same hardware, I observe more like a 5% slow-down under Windows.
Are you trying to benchmark the Windows code while the Linux
VM is running? That might be the cause. Maybe Hyper-V is
giving a higher priority to the Linux guest than to user code
running in the Windows host.
I'm also wondering if maybe CPU feature detection is borked
somehow. If you're comfortable building libjpeg-turbo from
source, try adding a print statement at the end of init_simd()
in simd/x86_64/jsimd.c and see if you get the same values for
simd_support and simd_huffman on both O/S platforms.
--
You received this message because you are subscribed to the Google Groups "libjpeg-turbo User Discussion/Support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to libjpeg-turbo-u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/libjpeg-turbo-users/a5faea8c-67cc-097e-32c0-5dec3b1b9528%40gmail.com.
I just discovered the pre-built Windows binaries - not sure how I overlooked these before - so I got 2.0.6 and it gives me comparable results - faster, in fact, perhaps because I/O is more direct - to Ubuntu. I must have messed something up when compiling 2.0.4, although I don't know what that might have been. I think I may have followed this guide:
https://github.com/libjpeg-turbo/libjpeg-turbo/blob/master/BUILDING.md
to generate the project files (it looks like I did so twice, in
separate directories, for x86 and x64), so maybe there was some
flag I should have set that I didn't. I couldn't see anything
amiss in the Project Properties though, and I made sure I was
doing Release builds.
Sorry if I've wasted your time, but thanks very much for your help!
(PS To link to the pre-built 2.0.6 library I had to link in legacy_stdio_definitions.lib and add my own implentation of __iob_func. I think this is because it was compiled with VS 2015 and I'm using VS 2019, which has inlined and redefined some stdio stuff)
David
You received this message because you are subscribed to a topic in the Google Groups "libjpeg-turbo User Discussion/Support" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/libjpeg-turbo-users/IwvQhDFfjXE/unsubscribe.
To unsubscribe from this group and all its topics, send an email to libjpeg-turbo-u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/libjpeg-turbo-users/1a55d360-ad8a-b051-8323-edcf6a39be36%40virtualgl.org.
Aha. OK, then my suspicion is that your custom build isn't
enabling the SIMD code at all for some reason. Pass
-DREQUIRE_SIMD=1 to cmake when configuring the build, and that
will cause the configuration to fail if it can't enable SIMD
instructions. It could be something as simple as NASM not being
installed and in your PATH.
2.0.6 was compiled with VS 2010. I started using VS 2015
with libjpeg-turbo 2.1, so the 2.1 beta1 release should avoid
that linkage issue.
To view this discussion on the web visit https://groups.google.com/d/msgid/libjpeg-turbo-users/4cfbada8-4e96-27ac-e93e-5756cd83aa5b%40gmail.com.