Inline immutable values in layout algorithm
Store immutable values from the node being laid out to avoid unnecessary method invocations during layout calculation. This gives us a 3%-5% performance boost in my benchmarks on Android.
This commit is contained in:
@@ -261,6 +261,9 @@ function transpileAnnotatedJStoC(jsCode) {
|
||||
.replace(/node\./g, 'node->')
|
||||
.replace(/child\./g, 'child->')
|
||||
.replace(/parent\./g, 'parent->')
|
||||
.replace(/getPositionType\((.+?)\)/g, '$1->style.position_type')
|
||||
.replace(/getJustifyContent\((.+?)\)/g, '$1->style.justify_content')
|
||||
.replace(/getAlignContent\((.+?)\)/g, '$1->style.align_content')
|
||||
.replace(/var\/\*\(c\)!([^*]+)\*\//g, '$1')
|
||||
.replace(/var\/\*([^\/]+)\*\//g, '$1')
|
||||
.replace(/ === /g, ' == ')
|
||||
|
Reference in New Issue
Block a user