syoyo/tinyexr

Significant Performance Regression from 2017(est) vs latest.

Zelex opened this issue · 3 comments

Zelex commented

We tried integrating the latest tiny_exr, but we saw a 2x performance degradation vs an older version of the lib.

Old version is roughly.... https://github.com/syoyo/tinyexr/blob/c2f7635a1d7653915b026a1f046bfc08a246cb1a/tinyexr.h

Some of the differences I notice vs newer is are

  1. latest has unaligned memory access protection via reading/writing individual bytes
  2. latest has more std::vector usage vs just flat C arrays

I'm sure there's more possible things to look into, but those are what I remember while I am typing this.

syoyo commented

latest has unaligned memory access protection via reading/writing individual bytes

This is required to support loading data in unaligned address.

latest has more std::vector usage vs just flat C arrays

This is required to avoid stack overflow. Optimizing std::vector may be possible by writing custom lock free STL allocator

I think first figuring out why the 2019 build slowed down so much would be worthwhile.

This is required to support loading data in unaligned address.

I would do some profiling to see if this is where the slowdown is, but a 2x speed hit for unaligned might be better on an optional TINYEXR_ALLOW_UNALIGNED switch.

syoyo commented

Nothing to do without reproducible build/run procedure and benchmarks