Nasal performance and benchmarks: Difference between revisions

Jump to navigation Jump to search
Line 94: Line 94:
tbd
tbd


== Results 2019-01 ==
== Results 2020-04 ==


=== simpleClass ===
=== simpleClass ===
Repeat count = 10000
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.015 ||  
| get via class.get() || 0.080 ||  
|-
|-
| get via class.variable || 0.006 ||  
| get via class.variable || 0.040 ||  
|-
|-
| set via class.set()|| 0.011 ||  
| set via class.set()|| 0.120 ||  
|-
|-
| set via class.variable || 0.004 ||  
| 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
|-
|-
| node.setValue() || 0.126 || ~25% faster
| props.getNode(path,1) || 0.400 || getting the node object seems expansive...
|-
|-
| node.getValue() || 0.125 || ~25% faster
| node.setValue() || 0.100 || ... while using it is fine
|-
|-
| setprop() || 0.178 ||  
| node.getValue() || 0.100 ||  
|-
|-
| getprop() || 0.164 ||  
| setprop() || 0.090 - 0.160 ||
|-
| getprop() || 0.090 - 0.170 ||  
|}
|}


252

edits

Navigation menu