Reducing Rendering Time
From Ultrafractal Wiki
also see: Reducing Convolution Filter Rendering Time
When we use classes/objects/plug-ins in UF5 there is a small overhead for using objects. The biggest single cause, however, of slow rendering has to do with the choices the user makes. I will use second layer of Ed's upr as an example of what I mean. For texture Ed uses Formula + Gradient Coloring Trap. This is a very cool formula that can create some really great textures. However there is a price. For each pixel (and each iteration of a pixel) for the main formula, there are additional iterations for Formula + Gradient Coloring Trap. Ed has chosen 50 iterations, and the max number of iterations on the formula tab is 1000, so there are potentially 50,000 iterations for each pixel. In reality it will be less than this because of bailout, but it will still be a large increase which will slow rending down. Also, we need to make sure the parameters we choose are realistic, as inappropriate parameter choices, especially for something that iterates within the iterations, is important. The baillout for Newton is 1e-12, which is fine. The coloring formula chosen is Fibers and Things Gradient. There is some header text that goes with Fibers and Things Gradient that states the bailout should be the same for the fractal formula and the coloring formula, i.e. 1e-12. The actual value entered in Fibers and Things is 10000 - very definitely a mismatch. In this case it didn't slow rendering down, but it prevented the formula from working as designed.
I am not really picking on Ed here. I am picking on everyone, as probably about 50% of the uprs have had similar problems on inappropriate parameters. On the positive side, experimentation with "unsusal" parameters can produce striking and useful effects, so I actually encourage doing it.
The main reason UF4 is much faster is that with UF4 you can't put an iteration on an iteration on an iteration, and relating piling on of plug-ins. That is the cost for all the cool things UF5 can do.
I just tried a little benchmarking. I did a zoom into a Julia set and colored with Exponential Smoothing (my original version, not the one in standard.ucl). I did the same thing, with the same amount of zoom, using a Julia plug-in and the class/object form of Exponential Smoothing. The timing was almost identical. Adding object may add a small amount of overhead, but that's not why things slow down.Its doing something within something within something that is the real cause of the slowdown.
Ron Barnett
Here is my promised submission analysis of a challenge 7 entry. It also
contains some analysis of some common issues I have seen that can
dramatically affect how fast the upr renders and how fast it loads. The upr
we are dealing with, by the way, is very interesting and has some unique
structure to it. The artist (Diane Walker) has created an excellent image.
The first set of issues affects performance more than anything else. Two layers had Transform Merge plugged in but never used. Three layers had Shape Collection for the trap shape, and two layers had a performance costly texture that was plugged in but never used (texture amount = 0). This upr is not uniques with these types of issues. They don't affect the appearance of the image, but the really degrade both loading and rendering performance. All of the extranenous stuff was removed. Getting rid of the Shape Collection involved the trick I talked about in a previous email using Trap
Render size: 640 x 539
Original load time: 15 sec Original render time: 2:10 min
Cleaned up load time: 1 sec Cleaned up render time: 39 sec
Exactly the same image, dramatically improved performance.
Here is the cleaned up upr.
Challenge7DW2_mod1 {
; Copyright © 2008 by Diane Walker.
::z56s4jn2t35WPOqRaY47jU+PY57nuhqAKqExNzMJZVkmdjyMS5mIZRbj7mZsBEgnD/73iiDG
PGj5wHR7K9eRkaD13XdgiqesHl6Zfq/2c/D/0P+DrWlHmfIwb9bex/whgonDWJW92/aFbzx4
dmrX9lwd5v45YZs6lgwnfJ3zmJXdw/bBpZeWFhvNNYXYem36/MOa1r9TjCyz/ZTjHZyHZGGu
/8bD9jCW9X+H+UQq+6u6rv+H/BdW0Nht+J5hxRer/Xqq4QR1kteVci/2w8v5ZaYs6YQ6zBqG
UgXmq+CiUXI/l4deHPdIPMxPLT3RS9jyS8TDiy9+Wg6SH9TSCjeusKUXNI17VmPwEcuhlwSK
f04Bmthw0yQINsXd0/5IPzHkCHhBn/j/w+4UV+91hf0/rhFxraMGrSCS3+Sw2P5Fvf/q9hqR
N/jqRw0gnsf40+jrXpqr0v5t+/80HD2m/rlpZdRaS285Nx6rWlcdvLZT1nezBVXRnoHOd4pf
6P/lXv5XPFVMomdI4b/+pDh+mV5pdEP85NPHEFkGutj0puZr6qzg3F+5ix3o87Vw9nieqqx8
Rdjpr6LPIL37ofUaHpIZzT+hHiPlrHIvK0sggdeGPIf0sI29Xez9Rmebjj+415MJ+LqHNsHV
N6woswdB/Uz0h9qbEFrmAmFfIcnnFz1x1yQyNb9c795+R78T39wptH0juVP+ebwef18L1lUN
4rT7hwoA/0VpBJB+5qKppKEuMmlNnNgq43Kfs9bp+7CVX6NxHiTVzYreGvt6jVTL2d8j265F
v9d/+m/T6Th5fI1PJrvguamx3f36Pf+R+VxX12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cDWcDWcDWcDWcDWcDWcDWcDWcDWcDWcDWcDWcDWcDWcDWcDWcDWcDWcDWcDWcDWcD
WcDWcDWcDWcDWcDWcDWcDWcDWcDWcDWcDWcDWcDWcDWcDWcDWcDWcDWcDWcDWcDWcDWcDWcD
WcDWcDWcDWcDWcDWcDWcDWcDWcDWcDWcDWcDWcDWcDWcDWcDWcDWcDWcDWcDWcDWcDWcDWcD
WcDWcDWcDWcDWcDWcDWcDWcDWcDWcDWcDWc7/Dt421ni5Fvy/rH8z/fCNudxB+zeVrqnBm5I
fED4eEKcPio2yHG1G+gZysY2safcc29HCTbTXjmbU7KEOv2yGWSr6kY4KkmWNl1Q0ShIu1+7
wsR3JMO7sQTE11nkLcctqvujdrcwNNddrvj0sRnJMplUUrHE7GfmY044EupsVaK6rcrBYzkW
DTX7hEzboykOKaxQUHJwQcjU0p7UKGi64qO23IJyuaJF/11XVN8ATpATpATpATpATpATpATp
ATpATpATpATpATpATpATpATpATpATpATpATpATpATpATpATpATpATpATpATpATpATpATpATp
ATpATpATpATpATpATpATpATpATpATpATpATpATpATpATpATpATpATpATpATpATpATpATpATp
ATpATpATpATpATpATpATpATpATpATpATpATpATpATpATpATpATpATpATpATpATpATpATpATp
ATpATpATpATpATpATpATpATpATpATpATpATpATpATpATpATpATpATpATp8PjpUccscYCzrNl
i01iZKaEzBr6ycuDv2DIianlYaJtYW8a/kIarnkLrA3GdmY3IFFejxVkOCnGjo460KLGSbbL
nrtliq5YdlqUc5MOn5c2eIFGBpq8GNyYhLFtbjcp7CpQFWXOUR0lPTEyuThbXaOpYcrjr66s
AGUZVrxsLux/FguHxFG=
}
Hi,
Just to emphasize Ron's point about cleaning up unused plug-ins in a UPR to speed up rendering - even Ron's version of Diane's UPR can be cleaned up further by changing some unused instances of "Trap Position" to "Null Transform" and some unused instances of "Trap Transfer" to "Null Transfer" (note here by 'unused' I mean in the sense that all the transform/transfer parameters are set at the defaults which is the same as just using the "Null" versions). Doing so won't improve performance anywhere near as much as the changes Ron made but it would often be worth making the changes on such a UPR prior to say doing a large disk render.
bye
Dave
