Skip to content

make image formats optional via features#342

Merged
cmyr merged 3 commits intolinebender:masterfrom
JAicewizard:master
Oct 21, 2020
Merged

make image formats optional via features#342
cmyr merged 3 commits intolinebender:masterfrom
JAicewizard:master

Conversation

@JAicewizard
Copy link
Contributor

@JAicewizard JAicewizard commented Oct 16, 2020

related to druid #1305, this PR makes piet default to no supported image formats, and allow adding support via features.
If only png and jpeg are required this cuts build times by 55% on my machine, and even with rayon build times are 35% less (for just piet).

added feature total deps total --realses build time (s)
0 3 1.3
image 21 4.9
image_png 32 5.5
jpeg 33 6.5
jpeg_rayon 60 9.7
gif 63 10.2
bmp 63 10.7
ico 63 10.8
tiff 65 12.2
webp 65 12.5
pnm 65 13
dds 65 13.7
tga 65 13.8
farbfeld 65 13.8
dxt 65 13.9
hdr 66 14.6

These build times are stacking, so the hdr build time also include png and jpeg...
But you can still clearly see that it is worth not having some of these, especially for the more obscure ones like everything after webp.
I have not benchmarked the impact on binary size, but I could make a small example program to see the impact on that.

Copy link
Member

@cmyr cmyr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, lets give this a shot. I was a little worried it would over-complicate things but we can always revisit if that ends up being the case.

@cmyr cmyr merged commit 52a8940 into linebender:master Oct 21, 2020
@JAicewizard
Copy link
Contributor Author

I don't like it either, but as it is the default features of image add a lot of bloat in total.
Please if you have another way of doing things linebender/druid#1305.
Should put in a PR for druid once this is in a pre-release?

@cmyr
Copy link
Member

cmyr commented Oct 21, 2020

@JAicewizard sounds good!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants