Prefer Paint Timing API over chrome.loadTimes() #1802
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Were you able to rebuild mod_pagespeed with this change and try it out? DId it fix the problem for you with the deprecation warnings?
Since the performance API provides higher resolution values, `Math.floor()` can give a value that is 1ms lower.
This looks good to me; did you get a chance to test this? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for doing this -- this is great stuff so far.
To clarify my previous question -- when I asked whether this compiles -- I meant in the mod_pagepseed build process.
What happens in the build process is that this file gets built by a javascript compiler called 'closure compiler' into a faster/smaller version of itself. The resultant JS file is then compiled into a C++ source file that represents the code as C strings, so it can be served directly from the module without having to find it on disk.
This whole flow is automated by the mod_pagespeed build system. But it looks to me like some of the JS you have here might not make the Closure Compiler happy (missing var declarations mainly).
I also don't know how you could test this fully without doing that. But if you actually have done that -- and I'm wrong about the missing var declarations causing the compile to fail -- then apologies :)
Just tested with the mod_pagespeed build process. Indeed, Closure Compiler doesn't like the omission of Right now, I noticed that the build process uses pre-optimized files in |
@injust is this good to go as far as you are concerned? |
Fixes apache/incubator-pagespeed-ngx#1537