antvis / gatsby-theme-antv

⚛️ Polished Gatsby theme for documentation site
https://gatsby-starter-theme-antv.antv.vision/zh
Other
344 stars 57 forks source link

fix: fix performance issues caused by query htmlAst #224

Closed NewByVector closed 4 years ago

NewByVector commented 4 years ago

In the G2Plot project, when Example reaches 200 files, it takes 10 minutes to start

github-actions[bot] commented 4 years ago

🎊 PR Preview d75d0d7e30f3bee013c0f49f1eee7aaca06af19c has been successfully built and deployed to https://antvis-gatsby-theme-antv-preview-pr-224.surge.sh

:clock1: Build time: 331.829s

🤖 By surge-preview

gatsby-cloud[bot] commented 4 years ago

Gatsby Cloud Build Report

gatsby-theme-antv

:tada: Your build was successful! See the Deploy preview here.

Build Details

View the build logs here.

:clock1: Build time: 5m

Performance

Lighthouse report

Metric Score
Performance :large_orange_diamond: 35
Accessibility :large_orange_diamond: 78
Best Practices :green_heart: 93
SEO :large_orange_diamond: 75

:link: View full report

afc163 commented 4 years ago

是不是有类似的问题:https://github.com/antvis/gatsby-theme-antv/blob/a15d101a440073b4a8460dad236eb2467b455247/%40antv/gatsby-theme-antv/site/templates/document.tsx#L259-L265

NewByVector commented 4 years ago

是不是有类似的问题:

https://github.com/antvis/gatsby-theme-antv/blob/a15d101a440073b4a8460dad236eb2467b455247/%40antv/gatsby-theme-antv/site/templates/document.tsx#L259-L265

查询速度在nodes个数到达150以上速度会指数上升,docs下面的文档数目一般都比较少,example特别多,所以在g2plot会暴露这个问题

NewByVector commented 4 years ago

是不是有类似的问题: https://github.com/antvis/gatsby-theme-antv/blob/a15d101a440073b4a8460dad236eb2467b455247/%40antv/gatsby-theme-antv/site/templates/document.tsx#L259-L265

查询速度在nodes个数到达150以上速度会指数上升,docs下面的文档数目一般都比较少,example特别多,所以在g2plot会暴露这个问题

Swatch组件在document里面还是有些地方使用的,先把example的去掉?

afc163 commented 4 years ago

可以,现在 example 里好像就没用到 Swatch。

afc163 commented 4 years ago

甚至可以尝试读一下 markdown 内容再判断是否要开启。