Repository navigation
#12 Implement Tiff Encoder benchmarks - #1496
JimBobSquarePants merged 1 commit into
Conversation
d364360 to
d83f327
Compare
| private Configuration configuration; | ||
|
|
||
| #if BIG_TESTS | ||
| private static readonly int BufferSize = 1024 * 68; |
There was a problem hiding this comment.
what is the reason to change the buffer size here?
There was a problem hiding this comment.
for large files suitable a larger buffer
quote from spec:
For maximum compatibility with operating systems such as MS-DOS and Windows, the StripOffsets array should be less than or equal to 64K bytes in length,
and the strips themselves, in both compressed and uncompressed forms, should
not be larger than 64K bytes
64+4
|
|
||
| private Configuration configuration; | ||
|
|
||
| #if BIG_TESTS |
There was a problem hiding this comment.
I would rather not use the #if BIG_TESTS here and only use the bigger images or why do you think there is a need for both? Does it take too long?
There was a problem hiding this comment.
ok i, think i can answer my one question here: I understand now why those images are called big 😄
I was not aware that those images are generated. The uncompressed images are more than 700MB, thats way to much.
I would suggest to use the Calliphora_x images in the Tiff folder for the benchmarks. With 804x1198 pixels they are reasonable big and we do not need the script to generate the images then.
There was a problem hiding this comment.
Yes, the files is very big and takes too long. For the repository they are large, but big files are actually for tiff. It's such a compromise... I'll look Calliphora_x files
There was a problem hiding this comment.
What's the resolution here? I can still see the conditional in place (now unused)
There was a problem hiding this comment.
ah yes, this case used for local stress testing, what way can you suggest to correctly implement this?
There was a problem hiding this comment.
Lets leave it as is then for now
| } | ||
| } | ||
|
|
||
| [IterationSetup] |
There was a problem hiding this comment.
I think the image bytes need to be loaded during GlobalSetup not in IterationSetup. Maybe do it the same way as for example DecodeFilteredPng.cs
There was a problem hiding this comment.
Yep, definitely global.
There was a problem hiding this comment.
is actually only loaded when needed: https://github.com/SixLabors/ImageSharp/pull/1496/files/d83f32704a669d3472685fdbb381c401240974f1#diff-3243ee1e2090c5162ac369f99493f7b1cccd702d463fdbc40880f44ced0474d0R81
Several files are used for testing, so that not all files are loaded into memory at once, only the current test file is loading.
| using (var memoryStream = new MemoryStream()) | ||
| { | ||
| this.tgaCore.SaveAsBmp(memoryStream); | ||
| this.tgaCore.SaveAsTga(memoryStream); |
There was a problem hiding this comment.
good spot: i thought i did already changed that in the past...
| public class DecodeTiff : BenchmarkBase | ||
| { | ||
| private byte[] tiffBytes; | ||
| public class Clr : Config.ShortClr |
There was a problem hiding this comment.
I'd much rather any configuration classes are kept together. If the column with is an issue make it global.
There was a problem hiding this comment.
ok, yes, I think it would be useful to increase the column for global
| return EncoderValue.CompressionCCITT3; | ||
|
|
||
| case TiffEncoderCompression.ModifiedHuffman: | ||
| return EncoderValue.CompressionRle; |
|
It'd be nice to see the actual results of the benchmarks in the ticket once we have them completed. |
d83f327 to
4f31e90
Compare
|
JimBobSquarePants
left a comment
There was a problem hiding this comment.
I'm happy for this to go in now in its current state. Very impressed by the benchmarks. Will have to profile the LZW ones to see why it's no much slower sometime though.
#12 Implement Tiff Encoder benchmarks
#12 Implement Tiff Encoder benchmarks
Prerequisites
Description