javascript - Pass around large object as argument -
general question:
affect performance when large object passed parameter vs when native variable passed?
case: i've written component manages google maps.
in each of methods of component, requires passing in google maps object since don't want set map property on component.
when pass object argument function - thing copied handler of object (that's address in memory object stored). object doesn't cloned, there's no overhead when pass big object argument.
if pass string cloned, in case length of string concern.
Comments
Post a Comment