|
From: Thorsten R. <tho...@sc...> - 2017-08-01 06:37:35
|
> The above values are from accessing some 8000 properties, which would > suggest that an individual property access from a props.nas Node > reference costs something in the region of 6 microseconds on my > machine (which amusingly wikipedia tells me is comparable to the time > to execute one machine cycle on an Intel 80186 microprocessor or 1960s > minicomputer!). Please test this with different numbers than 8000 as well - I seem to see strange non-linear behavior in the time with time per property increasing with total number of properties to be written (which I'm a bit at a loss how to interprete). > It's not clear to me whether using references from props.nas is > therefore "fast enough" or whether there is value in trying to improve > performance. For well-organized code (aka writing only when needed, organizing the displays in suitable groups, staggered updates...), it's going to be fast enough. For a straightforward approach to complicated displays probably not. A thousand properties sounds a lot, but every update in translation is already 2 properties, combined with a visible flag and color information you're down to 166 elements you can update already. If each of them is driven by reading a value from the tree you're losing even more. Generally, if there is a way of making either method faster, it would affect performance in a positive way all over Nasal scripting because currently property I/O is in my view the largest bottleneck (especially of canvas). * Thorsten |