252
edits
m (→simpleClass) |
|||
Line 94: | Line 94: | ||
tbd | tbd | ||
== Results | == Results 2020-04 == | ||
=== simpleClass === | === simpleClass === | ||
Repeat count = | Repeat count = 100000 | ||
Interpretation: using class methods can be 2-3x slower but is still ok. | Interpretation: using class methods can be 2-3x slower but is still ok. | ||
Line 104: | Line 104: | ||
! Test !! Time [s] !! Comment | ! Test !! Time [s] !! Comment | ||
|- | |- | ||
| get via class.get() || 0. | | get via class.get() || 0.080 || | ||
|- | |- | ||
| get via class.variable || 0. | | get via class.variable || 0.040 || | ||
|- | |- | ||
| set via class.set()|| 0. | | set via class.set()|| 0.120 || | ||
|- | |- | ||
| set via class.variable || 0. | | set via class.variable || 0.040 || | ||
|} | |} | ||
Line 117: | Line 117: | ||
It seems that any operation involving a property path (string) is relativly slow. | It seems that any operation involving a property path (string) is relativly slow. | ||
If you have to access a property more than once, e.g. in an update loop, you should create a props.Node object and use object.getValue(). | If you have to access a property more than once, e.g. in an update loop, you should create a props.Node object outside the loop and use object.getValue(). | ||
{| class="wikitable" | {| class="wikitable" | ||
Line 123: | Line 123: | ||
! Test !! Time [s] !! Comment | ! Test !! Time [s] !! Comment | ||
|- | |- | ||
| | | props.getNode(path,1) || 0.400 || getting the node object seems expansive... | ||
|- | |- | ||
| node. | | node.setValue() || 0.100 || ... while using it is fine | ||
|- | |- | ||
| | | node.getValue() || 0.100 || | ||
|- | |- | ||
| getprop() || 0. | | setprop() || 0.090 - 0.160 || | ||
|- | |||
| getprop() || 0.090 - 0.170 || | |||
|} | |} | ||
edits