Strange behavior of polymer

57 views
Skip to first unread message

oleksii.k...@gmail.com

unread,
Mar 3, 2014, 5:29:26 PM3/3/14
to polym...@googlegroups.com
I have a simple element imported to the index.html
<link rel="import" href="elements/radio.html">

it just display radio button.

then try to create dynamically XXX elements

document.addEventListener('polymer-ready', function(){
  var doc = document.createDocumentFragment(), el = null;
  for(var i =100; i-- > 0;){
     el = new RadioElement();
     doc.appendChild(el);
  }
  document.body.appendChild(doc);
});

the most time-cost line is:  doc.appendChild(el);

for 100 elements it take 30ms
for 300 - 26s
for 500 - more than 1 min.

Maybe I had made mistake somewhere. I stacked.

Eric Bidelman

unread,
Mar 3, 2014, 6:07:47 PM3/3/14
to oleksii.k...@gmail.com, polymer-dev
Even under the polyfills, 500 elements takes ~200ms for me. Is this what you see?


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/5bfdb37d-f005-423d-9dbb-ed5244f44d34%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Oleksii Khliupin

unread,
Mar 4, 2014, 12:32:09 AM3/4/14
to polym...@googlegroups.com, oleksii.k...@gmail.com
yes. the same... that's why i told that is very strange behavior. I'd try to debug deeply tomorrow. maybe i'll understand where the problem is.

thank you.

понедельник, 3 марта 2014 г., 18:07:47 UTC-5 пользователь Eric Bidelman написал:

Oleksii Khliupin

unread,
Mar 4, 2014, 11:39:05 AM3/4/14
to polym...@googlegroups.com, oleksii.k...@gmail.com
I had update a little bit your code: just add import styles inside template.

For the Firefox - it's working very fast, like without import styles tag.
For the Chrome - you can see browser slowdown.

already submitted issue to the chromium. we will see.


понедельник, 3 марта 2014 г., 18:07:47 UTC-5 пользователь Eric Bidelman написал:
Even under the polyfills, 500 elements takes ~200ms for me. Is this what you see?
Reply all
Reply to author
Forward
0 new messages