I'm making a dynamic UI with Polymer 2.0.0-rc.3 and various paper components and found out that this component is extremely slow. If a full a UI would have been implemented as this project aims for the load time would have been well over a minute. The HTTP requests are super fast, it's the rendering/CPU that seem to be the bottleneck.
The system I'm developing will create a UI from JSON structures fetched from an API end point so I can't know which fields would have to be there before hand. In the real system I initialize them in the JavaScript code like const menu = new MenuElement();. It works fast for basic componens but expecially for combined paper elements like these that uses paper-dropdown-menu-light, paper-listbox and paper-item render times becomes extreme.
I have created a small isolated example case and I'll attach some screenshots from Chromiums performance tab.
It looks like lots of methods that runs way more times than should be needed. Is there a way of initializing the components in another way that reduces the amount of times that these methods are called.
I'm hoping to solve this somehow since the Polymer initiative is such an easy way to split an application into small maintainable parts.
Oh, and this is the CPU I'm running this on Intel(R) Core(TM) i5-4310U CPU @ 2.00GHz
Expected outcome
The page should load and render well within a second from a local machine.
Description
I'm making a dynamic UI with Polymer 2.0.0-rc.3 and various paper components and found out that this component is extremely slow. If a full a UI would have been implemented as this project aims for the load time would have been well over a minute. The HTTP requests are super fast, it's the rendering/CPU that seem to be the bottleneck.
The system I'm developing will create a UI from JSON structures fetched from an API end point so I can't know which fields would have to be there before hand. In the real system I initialize them in the JavaScript code like const menu = new MenuElement();. It works fast for basic componens but expecially for combined paper elements like these that uses paper-dropdown-menu-light, paper-listbox and paper-item render times becomes extreme.
I have created a small isolated example case and I'll attach some screenshots from Chromiums performance tab.
Screenshots:
It looks like lots of methods that runs way more times than should be needed. Is there a way of initializing the components in another way that reduces the amount of times that these methods are called.
I'm hoping to solve this somehow since the Polymer initiative is such an easy way to split an application into small maintainable parts.
Oh, and this is the CPU I'm running this on Intel(R) Core(TM) i5-4310U CPU @ 2.00GHz
Expected outcome
The page should load and render well within a second from a local machine.
Actual outcome
It takes ~ 9 seconds to render the page.
Live Demo
Steps to reproduce
Browsers Affected