adopted-ember-addons / ember-cli-hot-loader

An early look at what hot reloading might be like in the ember ecosystem
MIT License
99 stars 13 forks source link

Component rendering speed up (using cache for same templates) #92

Closed lifeart closed 6 years ago

lifeart commented 6 years ago

I have alot of components on page > 300items.

And after hot-loader I see some rendering perf issues. This pr solve rendering speed problem, providing caching for already compiled templates At this moment cache size is 10k items, don't think we need more.

changes in addon/components/hot-replacement-component.js

results before: image

results after:

image

Idea is: Before calling Ember.HTMLBars.compile we calculate simple template string hash. And if we have already compiled template for this hash, we reuse it, instead of compiling it one more time.

toranb commented 6 years ago

Interesting! I'm down to see this in action but wanted to know if you could wait until we merge that other PR to avoid messy/dup commits that seem to be present in both PRs right now

lifeart commented 6 years ago

@toranb done! Looks like github rebase issue (. Clean pr in - https://github.com/toranb/ember-cli-hot-loader/pull/94