-
Notifications
You must be signed in to change notification settings - Fork 3
Possible Optimizations
Because filmulate() happens in the middle of the editing process, it is very important that it be as fast as possible in order to give responsive previews to the user. This wiki page documents what improvements are suggested to improve speed.
When applying the blur to developer_concentration, we first copy a whole row into a vector, mirroring the edges of the row for padding. While it is useful to copy the areas that have mirroring (makes for better caching), copying the rest of the row is probably unnecessary and takes some (probably short) time. We could see how much speed we gain by diffusing most of the row in place, without copying it back and forth.
In develop(), many matrices have to be loaded and juggled around in cache. It may be more efficient if we had a matrix of structs where each struct had the crystal_radius and silver_salt_density for r,g, and b elements of a pixel. developer_concentration should probably be kept separate so that diffuse() does not have to load these elements into cache.
In develop() we write out similar processes for calculating crystal_radius and the like for each sub-element (RGB) of a pixel. When we tried putting these calculations in a loop instead, we saw a performance drop.