Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Running phantomas against single page applications #474

Open
macbre opened this issue Jan 19, 2015 · 5 comments
Open

Running phantomas against single page applications #474

macbre opened this issue Jan 19, 2015 · 5 comments
Labels
Milestone

Comments

@macbre
Copy link
Owner

macbre commented Jan 19, 2015

@william-p / @gmetais - any suggestions / examples?

  • measuring transitions between application states
  • triggering events (from phantomas run) that causes application transition
@macbre macbre added this to the Roadmap milestone Jan 19, 2015
@gmetais
Copy link
Contributor

gmetais commented Jan 20, 2015

Measuring all the metrics while changing from page A to page B sounds definitely interesting to me. I never analyzed webperf on this kind of transition but I'm curious to see the results. Also I don't know any tool able to do it and that's a good enough reason to make it.

SPA can be very CPU consuming on transitions, when new data needs to be transformed into DOM elements that are then rendered with the correct style and bound to events. I guess most of the frameworks do all of this in a single shot (synchronous JS) so it might be possible to measure this CPU time. Probably difficult, but possible.

Not-parallelized ajax calls could be a performance problem too: a first call to the API triggers a second call, which triggers a third call... Don't know if it's a real case though.

I'll try to think of some other possible problems.

@gmetais
Copy link
Contributor

gmetais commented Aug 12, 2015

Here are some nice JS snippets that measure some Angular specific metrics:
https://github.com/bahmutov/code-snippets#angular-performance (thank you @bahmutov !)

This can be a good starting point for transitions measurements. We probably won't be able to get metrics that work for every JS framework, so being framework specific could be a good solution.

@gmetais
Copy link
Contributor

gmetais commented Nov 3, 2015

Last week I saw a great Velocity Conf talk, called "Measuring the performance of SPAs", by @nicjansma and @bluesmoon (hi there!). Both of them are contributors in Boomerang, a RUM tool. They are working on having similar metrics for a SPA.

Slides are here: http:https://fr.slideshare.net/nicjansma/measuring-the-performance-of-single-page-applications

TL;DR It's not easy. Here is what they do:

  • listen to page change events sent by the different frameworks,
  • wrap the XHR methods to capture Ajax metrics
  • use DOM Observers to detect new images in the DOM and capture onload
  • add some intelligence to avoid false detections

@nicjansma
Copy link

Thanks @gmetais, this is a really cool project that I hadn't heard about before.

The SPA-monitoring code we have is in akamai/boomerang#68 in plugins/auto_xhr.js. It's rather complex, and is still being tweaked.

Monitoring SPAs is hard!

@macbre
Copy link
Owner Author

macbre commented Nov 3, 2015

@gmetais, thanks for the links. I guess one would need to write an app-specific custom module to monitor single page application.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants