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

[infra] GitHub actions no longer completes a build or test #1201

Open
AndrewJakubowicz opened this issue Oct 2, 2023 · 2 comments
Open

[infra] GitHub actions no longer completes a build or test #1201

AndrewJakubowicz opened this issue Oct 2, 2023 · 2 comments

Comments

@AndrewJakubowicz
Copy link
Contributor

Context

As of a couple days ago, all GitHub actions now fail on any new PR on this repo.

Screenshot 2023-10-02 at 1 38 09 PM

The site still deploys, and preview URLs still work, so this does not block content changes.
However, it increases the risk of infrastructure changes.

Augustine did some investigating as a possible starting point (rephrased from chat):

There is a `BlockingRender` that exists (which makes some async work sync). It uses `Atomic.wait`, and `Atomics.notify`. At some point it may be that there are so many things happening, that there are not enough cycles for the worker thread to pick up the render request. They hang until one times out.
@AndrewJakubowicz
Copy link
Contributor Author

Theory is that the very slow build time of lit.dev is due to the special syntax highlighting that is done.

I changed the dev:build command to 0x ../../node_modules/@11ty/eleventy/cmd.js --quiet which runs eleventy and generates a flamegraph using 0x.

Here is the full flamegraph of building the site:
Screenshot 2023-10-18 at 10 23 41 AM

If we color all the work that uses playwright to emulate a browser, we can see a huge amount of the work is playwright related:
Screenshot 2023-10-18 at 10 24 48 AM

And if we filter for renderer.ts or blocking-renderer.ts, this also reveals the length of time spent syntax highlighting:
Screenshot 2023-10-18 at 10 27 47 AM

Some rough numbers (on my M2 silicon mac)

Note the table should be read from top to bottom, and I am removing features using if (!DEV) { ... } flag.

Features Time
Current dev:build time 17.24 seconds (46.2ms each)
Without blocking renderer 11.28 seconds (30.2ms each)
Without search index creation 7.97 seconds (21.4ms each)

It is possible to remove search index creation in dev mode because we don't upload dev mode search indexes to algolia, so it's wasting time.

Proposal

  1. Easy win: do not create search index in dev mode.
  2. Not so easy win: do not use the blocking renderer in dev mode.

@AndrewJakubowicz
Copy link
Contributor Author

Found a third slow path once I added caching to the blocking-renderer.

See flame graph of our lit-eleventy-plugin highlighted in blue:

Screenshot 2023-10-18 at 3 57 45 PM

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

No branches or pull requests

1 participant