Skip to content
This repository has been archived by the owner. It is now read-only.

wg-analytics Status Update 2020-03-16 #19

Closed
zhouyx opened this issue Mar 16, 2020 · 3 comments
Closed

wg-analytics Status Update 2020-03-16 #19

zhouyx opened this issue Mar 16, 2020 · 3 comments

Comments

@zhouyx
Copy link
Contributor

zhouyx commented Mar 16, 2020

What was accomplished

  • Benchmark <amp-analytics> performance and pageView delay
  • Use existing performance testing framework to also measure request delay.
  • Explore solutions to reduce analytics related long tasks. (chunk, worker)

What's next

  • <amp-consent> gdprApplies field
  • Continue work to reduce analytics related long tasks
  • Reduce <amp-analytics> pageView delay. Some proposals include: include vendor predefined config inline, introduce a lite component for ads.
@dreamofabear
Copy link

dreamofabear commented Mar 16, 2020

Explore solutions to reduce analytics related long tasks. (chunk, worker)

Curious about the results for this, if they're available.

@jridgewell
Copy link

jridgewell commented Mar 16, 2020

What was accomplished

  • Disabled AMP Cors for analytics vendors requests

Lessons learned

What's next

@zhouyx
Copy link
Contributor Author

zhouyx commented Mar 16, 2020

Some early findings:

Web worker

  • The cost to initiate the web worker is pretty high, around 200ms. That leads to a more than 200ms delay in the pageView. (tested with low end device)
  • Due to the fact that web worker script needs to be from same origin, it's also very challenging to preload the worker script.
  • I found expandTemplate to be quite expensive. So if that's called enough time, a separate web worker is still under consideration.

Chunk

  • An early prototype proves chunking can eliminate long tasks easily.
  • The delay we are seeing now is reasonable. However this is because we are only testing with a single <amp-analytics> on the page. Still need to understand the change with real example pages.

@zhouyx zhouyx closed this as completed Apr 27, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants