Git Product home page Git Product logo

Comments (6)

yin1999 avatar yin1999 commented on July 19, 2024 1

After the fix (#8806) is applied, the build time is reduced to 3.5s. Let's see if there is side-effect made by the fix for a few days. If nothing happend, I'll close this PR :)

image

from yari.

caugner avatar caugner commented on July 19, 2024

Please note that individual workflow runs are not necessarily comparable, as workflow runners use a variety of CPUs.

from yari.

yin1999 avatar yin1999 commented on July 19, 2024

Please note that individual workflow runs are not necessarily comparable, as workflow runners use a variety of CPUs.

Sorry about ignoring that, I just made a local test, and found that:

run node node_modules/@mdn/yari/build/cli.js files/zh-tw/learn/common_questions/web_mechanics/what_is_a_web_server/index.md

use @mdn/[email protected]:

13.639s is used to gather translations.

image

use @mdn/[email protected]:

1.831s is used to gather translations.

image

Test platform:

OS: Linux debian 6.1.0-3-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.8-1 (2023-01-29) x86_64 GNU/Linux
Node.js: v18.13.0
Yarn: 1.22.19 (Debian package: [email protected]+~cs24.27.18-2)
CPU: 13th Gen Intel(R) Core(TM) i5-13600K

With 1TB SSD and 32GB memory

from yari.

caugner avatar caugner commented on July 19, 2024

I compared @mdn/[email protected] and @mdn/[email protected] and indeed the build performance has degraded significantly:

  • 1.36.4: 19.0 seconds
  • 2.0.0: 49.0 seconds

from yari.

queengooborg avatar queengooborg commented on July 19, 2024

On bf23810, I ran yarn build files/zh-tw/learn/common_questions/web_mechanics/what_is_a_web_server/index.md and the command completed in ~19 seconds:

❯ yarn build files/zh-tw/learn/common_questions/web_mechanics/what_is_a_web_server/index.md
yarn run v1.22.19
$ cross-env NODE_ENV=production ts-node build/cli.ts files/zh-tw/learn/common_questions/web_mechanics/what_is_a_web_server/index.md
(node:36300) ExperimentalWarning: Importing JSON modules is an experimental feature and might change at any time
(Use `node --trace-warnings ...` to show where the warning was created)
CONTENT_ROOT:            /Users/queengooborg/Developer/Gooborg/mdn-content/files
CONTENT_TRANSLATED_ROOT: /Users/queengooborg/Developer/Gooborg/mdn-translated-content/files
Time to gather all translations: 16.302s
Language does not exist: svelte
/Users/queengooborg/Developer/Gooborg/yari/client/build/zh-tw/docs/learn/common_questions/web_mechanics/what_is_a_web_server
Built 1 pages in 17.5 seconds, at a rate of 0.1 documents per second.
Peak heap memory usage: 300 MB


Total_Flaws_Count
broken_links  8
macros        1


✨  Done in 19.45s.

The time spent gathering all the translations is definitely quite high, I wonder what's causing the sudden change in build times, hmm...

from yari.

queengooborg avatar queengooborg commented on July 19, 2024

In v2.5.5 (the latest as of this comment) on a brand new package and folder made specifically for testing Yari, I found that the time spent went down significantly to ~4.3s:

❯ node node_modules/@mdn/yari/build/cli.js files/zh-tw/learn/common_questions/web_mechanics/what_is_a_web_server/index.md
(node:46939) ExperimentalWarning: Importing JSON modules is an experimental feature and might change at any time
(Use `node --trace-warnings ...` to show where the warning was created)
CONTENT_ROOT:            /Users/queengooborg/Developer/Gooborg/mdn-content/files
CONTENT_TRANSLATED_ROOT: /Users/queengooborg/Developer/Gooborg/mdn-translated-content/files
Time to gather all translations: 4.300s
Language does not exist: svelte
/Users/queengooborg/Developer/tmp-yari-test/node_modules/@mdn/yari/client/build/zh-tw/docs/learn/common_questions/web_mechanics/what_is_a_web_server
Built 1 pages in 5.2 seconds, at a rate of 0.2 documents per second.
Peak heap memory usage: 252 MB


Total_Flaws_Count
broken_links  8
macros        1

And in v1.36.4, I get around the same time.


When I was trying to dig into profiling and performance, I ran a profiler through Chrome's debug panel (within Yari, using the latest branch), and I found something interesting:

Screenshot 2023-02-25 at 05 26 40

I don't see much of a reason that the front-matter package would be causing such an issue... Maybe it's something to do with NodeJS wrapping CJS to ESM?

from yari.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.