# Collecting performance metrics using renderTemplate hook and User Timing API

**URL:** https://discuss.emberjs.com/t/collecting-performance-metrics-using-rendertemplate-hook-and-user-timing-api/7270
**Category:** Performance
**Created:** [February 8, 2015, 5:59pm UTC](https://discuss.emberjs.com/t/collecting-performance-metrics-using-rendertemplate-hook-and-user-timing-api/7270 "2015-02-08T17:59:03Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![pixelhandler](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.emberjs.com/pixelhandler/32/18649_2.png) [@pixelhandler](https://discuss.emberjs.com/u/pixelhandler)
#### Post date: [February 8, 2015, 5:59pm UTC](https://discuss.emberjs.com/t/collecting-performance-metrics-using-rendertemplate-hook-and-user-timing-api/7270/1 "2015-02-08T17:59:03Z")

</div>

For my pet project, on iPhone, I’m seeing up to about 40-50% performance increase with HTMLBars (Ember1.10) vs Handlebars 1.3 (Ember 1.8) See: [https://twitter.com/pixelhandler/status/564476770595143683](https://twitter.com/pixelhandler/status/564476770595143683)

Ember 1.10 (HTMLBars) [http://pixelhandler.com/api/metrics/durations?name=index\_view&emberVersion=1.10&userAgent=iPhone](http://pixelhandler.com/api/metrics/durations?name=index_view&emberVersion=1.10&userAgent=iPhone)[http://pixelhandler.com/api/metrics/durations?name=application\_view&emberVersion=1.10&userAgent=iPhone](http://pixelhandler.com/api/metrics/durations?name=application_view&emberVersion=1.10&userAgent=iPhone)

Ember 1.8 (Handlebars) [http://pixelhandler.com/api/metrics/durations?name=index\_view&emberVersion=1.8&userAgent=iPhone](http://pixelhandler.com/api/metrics/durations?name=index_view&emberVersion=1.8&userAgent=iPhone)[http://pixelhandler.com/api/metrics/durations?name=application\_view&emberVersion=1.8&userAgent=iPhone](http://pixelhandler.com/api/metrics/durations?name=application_view&emberVersion=1.8&userAgent=iPhone)

And on a userAgent search for Mobile about 15% increase [http://pixelhandler.com/api/metrics/durations?name=index\_view&emberVersion=1.10&userAgent=Mobile](http://pixelhandler.com/api/metrics/durations?name=index_view&emberVersion=1.10&userAgent=Mobile)[http://pixelhandler.com/api/metrics/durations?name=index\_view&emberVersion=1.8&userAgent=Mobile](http://pixelhandler.com/api/metrics/durations?name=index_view&emberVersion=1.8&userAgent=Mobile)

Here is the API I made to search the metrics: [https://github.com/pixelhandler/blog/tree/master/server#metrics-api-endpoints](https://github.com/pixelhandler/blog/tree/master/server#metrics-api-endpoints) I ran Ember 1.8 for about a day then when 1.10 shipped ran that only since last night, but average index\_view template load times are looking better.

Last week I added User Timing measurements in the renderTemplate hook like so [https://github.com/pixelhandler/blog/commit/167be4c321a823c9ad8a9ff6569fed7672dd0cd8](https://github.com/pixelhandler/blog/commit/167be4c321a823c9ad8a9ff6569fed7672dd0cd8) I’m made some tweeks on the analytics data collection since then.

**I’m curious how are you measuring performance in your Ember apps ?**

See Post: [Measuring Performance with User Timing API, in an Ember Application](http://pixelhandler.com/posts/measuring-performance-with-user-timing-api-in-an-ember-application)

---

<div class="post-metadata">

### Author: ![jthoburn](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.emberjs.com/jthoburn/32/12401_2.png) [@jthoburn](https://discuss.emberjs.com/u/jthoburn)
#### Post date: [February 8, 2015, 6:59pm UTC](https://discuss.emberjs.com/t/collecting-performance-metrics-using-rendertemplate-hook-and-user-timing-api/7270/2 "2015-02-08T18:59:20Z")

</div>

Did you run any metrics on memory overhead differences between the two?

---

<div class="post-metadata">

### Author: ![pixelhandler](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.emberjs.com/pixelhandler/32/18649_2.png) [@pixelhandler](https://discuss.emberjs.com/u/pixelhandler)
#### Post date: [February 8, 2015, 9:09pm UTC](https://discuss.emberjs.com/t/collecting-performance-metrics-using-rendertemplate-hook-and-user-timing-api/7270/3 "2015-02-08T21:09:57Z")

</div>

No, I measured general analytics plus render timings (with user timings) window.performance

---

<div class="post-metadata">

### Author: ![jthoburn](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.emberjs.com/jthoburn/32/12401_2.png) [@jthoburn](https://discuss.emberjs.com/u/jthoburn)
#### Post date: [February 8, 2015, 9:14pm UTC](https://discuss.emberjs.com/t/collecting-performance-metrics-using-rendertemplate-hook-and-user-timing-api/7270/4 "2015-02-08T21:14:02Z")

</div>

I’ll be upgrading our cordova iOS app this week, I’ll try to pull out some CPU/Memory usage differences. I’m really hoping this reduced Ember’s footprint, which would help Android performance on poor devices a lot.

---

<div class="post-metadata">

### Author: ![rwjblue](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.emberjs.com/rwjblue/32/9411_2.png) [@rwjblue](https://discuss.emberjs.com/u/rwjblue)
#### Post date: [February 9, 2015, 12:10am UTC](https://discuss.emberjs.com/t/collecting-performance-metrics-using-rendertemplate-hook-and-user-timing-api/7270/5 "2015-02-09T00:10:54Z")

</div>

@jthoburn - The total size is slightly less (102kb min+gz), but not massively less.

---

<div class="post-metadata">

### Author: ![jthoburn](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.emberjs.com/jthoburn/32/12401_2.png) [@jthoburn](https://discuss.emberjs.com/u/jthoburn)
#### Post date: [February 9, 2015, 1:01am UTC](https://discuss.emberjs.com/t/collecting-performance-metrics-using-rendertemplate-hook-and-user-timing-api/7270/6 "2015-02-09T01:01:50Z")

</div>

@rwjblue I meant runtime footprint 😉

A lot of Android devices have \<= 250MB RAM and powerless CPUs. We ran into a lot of problems building an Android app that would work well on non-flagship phones. Our Ember runtime often hits 50-100MB in Chrome and can spike higher. I’ve been working pretty hard to reduce this (successfully), but am hoping HTMLbars will give that work a good boost. I was able to get a few metrics off the HTMLbars beta that suggested there would be improvement, but too many addons (including some of my own) weren’t ready for HTMLbars at the time to get a true read.

---

<div class="post-metadata">

### Author: ![pixelhandler](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.emberjs.com/pixelhandler/32/18649_2.png) [@pixelhandler](https://discuss.emberjs.com/u/pixelhandler)
#### Post date: [February 9, 2015, 6:31am UTC](https://discuss.emberjs.com/t/collecting-performance-metrics-using-rendertemplate-hook-and-user-timing-api/7270/7 "2015-02-09T06:31:19Z")

</div>

@jthoburn Just saw this link via ember weekly newsletter [https://github.com/stefanpenner/ember-browser-stats](https://github.com/stefanpenner/ember-browser-stats)

---

<div class="post-metadata">

### Author: ![jthoburn](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.emberjs.com/jthoburn/32/12401_2.png) [@jthoburn](https://discuss.emberjs.com/u/jthoburn)
#### Post date: [February 9, 2015, 7:21am UTC](https://discuss.emberjs.com/t/collecting-performance-metrics-using-rendertemplate-hook-and-user-timing-api/7270/8 "2015-02-09T07:21:44Z")

</div>

@pixelhandler That’s awesome! Missed that in the newsletter.

---

<div class="post-metadata">

### Author: ![jthoburn](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.emberjs.com/jthoburn/32/12401_2.png) [@jthoburn](https://discuss.emberjs.com/u/jthoburn)
#### Post date: [February 20, 2015, 5:25pm UTC](https://discuss.emberjs.com/t/collecting-performance-metrics-using-rendertemplate-hook-and-user-timing-api/7270/9 "2015-02-20T17:25:44Z")

</div>

Not sure if anyone else is seeing this but I suspect there may be a memory leak in Ember 1.10. I haven’t had time to dig into any profiles to see what exactly is going on. Initially, 1.10 helps our our memory usage ~30%, but leaving our app running, its memory usage now perpetually climbs ~.25-1 MB / minute.

Curious if anyone else has observed this.
