This repository was archived by the owner on Oct 19, 2018. It is now read-only.
This repository was archived by the owner on Oct 19, 2018. It is now read-only.
render performance, should_component_update? #240
Open
Description
A reason for slow and repeated rendering is, that should_component_update?
when checking if params are updated may always lead true. This is due to limitations of javascript. It is recommended to use simple data types as params for best performance, strings, numbers to avoid this effect.
The use of blocks or javascript functions or anything else that cannot be represented or compared reasonably by opals ruby types should be avoided. Comparing props with these types will always lead true for should_component_update?
and cause a render.
This should also be considered when overwriting should_component_update?(next_props_hash, next_state_hash)
, its best to work with simple data types.