Skip to content
Snippets Groups Projects
Commit fc8d97ce authored by Luc Hermitte's avatar Luc Hermitte Committed by Victor Poughon
Browse files

PERF: Avoid allocation induced by VLV pixels

The `DifferenceImageFilter` is often used on `VectorImage`s, in particular when
doing `compare-image`.

Creating new `VariableLengthVector` pixels at each iteration, or casting them
will automatically end up in construction and destruction of VLV pixels, and
thus allocation and liberation of heap memory. This is not efficient.

This commit aims at minimizing the number of allocation by factorizing out
everything that can be (pixel size, typical max value, typical zero value).
Resetting value is done by assignment, which has the good property of not
inducing any allocation on VLV variables.
parent b28c5338
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment