overhead of polymer-element bind data change monitoring

100 views
Skip to first unread message

Just.A.Guy

unread,
Feb 25, 2014, 2:07:37 PM2/25/14
to polym...@googlegroups.com
I don't know how polymer does data binding.
I suspect it is using some time of "onChange" listener.

The more elements that there are to bind increases the overhead of supporting the two-way sync process.

I am wondering if there is not some waste in all that monitoring. In my experience there are two types
of data values.  

a. Constant - these are set at the time of the instance instantiation and do not change during the remaining time of execution.
b. non-constant - these change when the end user interacts with the application.

It seems that polymer only provides support for the type-b variables.  Yet because of that, as the number of variables
increases, performance can suffer.  If there was a way to identify type-a (constants), and then only bind those values
once (after ready?) without change monitoring, then the amount of monitoring for change may have a smaller impact.

Or maybe there is a type-c variable which is only changed by some javascript in a callback routine. Then provide
a function that re-values those changed variables.  And have the callback script call it after it makes a change.
That way the only monitored variables would be those that the end user can change. 
 

Rafael Weinstein

unread,
Feb 25, 2014, 2:27:39 PM2/25/14
to Just.A.Guy, polymer-dev
Polymer databinding supports one-time binding. Unfortunatey, this isn't documented yet (just opened this bug: https://github.com/Polymer/docs/issues/282), but the basic behavior is:

-any place you would use a double-mustache {{ foo }} to create a dynamic binding, you can use double brackets [[ foo ]] to create a one-time binding. This will not incur the overhead of setting up an observer.


Follow Polymer on Google+: plus.google.com/107187849809354688692
---
You received this message because you are subscribed to the Google Groups "Polymer" group.
To unsubscribe from this group and stop receiving emails from it, send an email to polymer-dev...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/polymer-dev/509d5629-e1be-4b48-8321-283f8a8986fd%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Eric Bidelman

unread,
Feb 25, 2014, 2:39:04 PM2/25/14
to Rafael Weinstein, Just.A.Guy, polymer-dev
Forgot to close that issue. We have docs here:

Although, "Expressions" seems like the wrong page for this. Admittedly, all of the data-binding docs need a large overhaul :\


Reply all
Reply to author
Forward
0 new messages