Querying the list of properties and fields on an object on HXCPP platforms is very expensive, and it could be a moderate performance benefit to cache this information when able.
Create a map and store the result of Reflect.fields() on scripted classes.
Check whether a field is a property and use setField over setProperty where appropriate.
Check timings to gauge performance improvements.
Check whether reflection caching is slower than not using it on JS.
Querying the list of properties and fields on an object on HXCPP platforms is very expensive, and it could be a moderate performance benefit to cache this information when able.
Reflect.fields()
on scripted classes.setField
oversetProperty
where appropriate.