09-18-2008 12:47 AM
knicewar wrote:But here's what's weird: with the defer, the cluster array is incredibly slow
It is slow because now you use property nodes (defer panel updates).
The faster way is to avoid property nodes at all.
The second faster (i can think off) is to use the defer panel updates more efficiently.
Sometimes i use an event structure outside the main program, with timeout every 100ms. There i switch defer panel updates "on" and back "off". That way, i have 10 updates every sec.
09-18-2008 11:11 AM - edited 09-18-2008 11:14 AM
Well, maybe you should try to determine if your benchmarks are even relevant to your real-world scenario. Do you really have performance issues?
You also have some poor coding habits. For example instead of the "local read...modify...local write" in the table case, use a shift register in the outer loop (initialized with the wire currenty going to the table terminal) and write to the table terminal instead. For e.g. the table case, you can also merge the two FOR loops into one.
You can dramatically limit the cost overhead if you code all this a little smarter. Most of the time, the values probably stay at their current limit status between iterations, so all you need to do is update the numeric values. In the rare case where one or two values change their limit status, all you need to do is update the background of these cells, nothing more!