estanglerbm commented on pull request #969:
URL: https://github.com/apache/royale-asjs/pull/969#issuecomment-738695569
There are two new members in XML:
```
private var _notification:Function;
private var _internalSuppressNotify:Boolean;
```
Most of the changes are sprinkling of calls to xml$_notify(). That new
function only calls the notification function if it's been set (through a
previous call to setNotification()). It will bubble up to the parent only if
the global variable recursiveNotify is set to true (default is false). So if
you never call setNotification() and you never set recursiveNotify, there is
just a call to a do-nothing function in each of the various operations.
The changes in setChildren() are a little bit more, only because of the
specific legacy behavior of Flex. But not a lot more, in my opinion.
If you're using XMLNotifier, then each XML will get its own notification
function allocated by XMLNotifier (that's how it works). And each notification
function will hold / release a reference to the watcher(s), through watchXML()
and unwatchXML(). So at any point in time, there could be a lot of XMLs with
notification functions and references to one or more watchers. But all that
stuff with XMLNotifier is part of the price of using that, if you want to use
it.
I have not run benchmarks of before vs. after on XML in JS, beyond using it
in a real app with a lot of XML. I did try to have little impact while still
making changes that wouldn't be fragile (hence the xml$_notify() function
instead of inline).
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]