Nuxt.js: User timings for @nuxt modules

Created on 2 Aug 2020  路  1Comment  路  Source: nuxt/nuxt.js

Is your feature request related to a problem? Please describe.

Originally bought up in https://github.com/nuxt-community/i18n-module/issues/815 and related to https://github.com/nuxt/nuxt.js/issues/6467

It's not always obvious what makes up script evaluation times in a live deployment, or how much an initial performance impact comes from adding new modules. This is especially an issue if you are looking at your site through a non-interactive report generated by a perf tool like lighthouse or sitespeed.io.

Describe the solution you'd like

It would be nice if the user timings api could be used to automatically add performance marks to all nuxt modules. That way it's super obvious the performance impact of each module.

Describe alternatives you've considered

Even if it's not technically possible to add marks automatically at the nuxt level because of all the different possibilities. It could at least be made standard practice in @nuxt and nuxt-community managed modules to add some level of user timing marks.

Additional context

https://web.dev/user-timings/
https://developer.mozilla.org/en-US/docs/Web/API/User_Timing_API/Using_the_User_Timing_API

feature-request

Most helpful comment

I guess you've made a mental shortcut but "modules" run at build time so it wouldn't be that important to time that.

What Nuxt can and should time is:

  • plugins
  • middleware
  • initialization of internal plugins like VueRouter and other
  • ...

For plugins and middleware it would probably need to track from which modules those came (if they did) so that one could tell by looking at the metrics.

>All comments

I guess you've made a mental shortcut but "modules" run at build time so it wouldn't be that important to time that.

What Nuxt can and should time is:

  • plugins
  • middleware
  • initialization of internal plugins like VueRouter and other
  • ...

For plugins and middleware it would probably need to track from which modules those came (if they did) so that one could tell by looking at the metrics.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

o-alexandrov picture o-alexandrov  路  3Comments

mattdharmon picture mattdharmon  路  3Comments

gary149 picture gary149  路  3Comments

VincentLoy picture VincentLoy  路  3Comments

jaredreich picture jaredreich  路  3Comments