How many pages can VuePress have?
In VuePress, although the content of pages is acquired dynamically, the metadata of the pages such as title, url, frontmatter is statically defined and all loaded when a single page is accessed.
I put a hypothesis that, the more pages a website has, the more likely to give low performance it is.
Then, I tried to measure performances changing the number of pages.
- Score by PageSpeed Insights (opens new window)
- Performance I feel when I actually see it with a browser
- Time taken to build
# Measurements
First, I created a VuePress site with almost no pages, and then measured its score by PageSpeed Insights (opens new window). The result is 99 points for smartphones and 100 points for PC.
Then, I gradually increased pages in the VuePress project and measures each score for each case.
$ cd src/articles/nginx/
$ for ((i=0; i < 100; i++)); do cp dummy.md dummy${i}.md; done
$ yarn build && rsync ... # upload files
2
3
When I made 100 pages, I didn't feel it wat slow, but the score by Page Speet Insights decreased to around 70-80 points for PC and around 60-70 points for smartphones.
I increased more.
$ for ((i=0; i < 300; i++)); do cp dummy.md dummy${i}.md; done
$ yarn build && rsync ...
$ for ((i=0; i < 600; i++)); do cp dummy.md dummy${i}.md; done
$ yarn build && rsync ...
$ for ((i=0; i < 1000; i++)); do cp dummy.md dummy${i}.md; done
$ yarn build && rsync ...
2
3
4
5
6
7
8
With 300 pages or 600 pages, I didn't feel so slow and the score didn't change so. With 1,000 pages, the score decreased to about 50 points, but I didn't feel so slow eather.
How about time taken to build?
It increased while increasing pages.
I use Mac OS Big Sure, with 600 pages, it takes about 60 seconds to build, and with 1,000 pages, about 90 seconds.
With 1,500 pages, building the site was failed because of memory shortage.
FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory
# Result
Result is following:
Pages | Score for SP | Score for PC | Time(seconds) |
---|---|---|---|
100 | 67 | 82 | 23 |
300 | 66 | 71 | 30 |
600 | 67 | 70 | 61 |
1000 | 50 | 73 | 92 |
Although PageSpeed Insights may give a low score, it seems VuePress is usually able to have around 1,000 pages (or more if your computer has better performance).
Related posts
- How to Avoid Embedding Google Adsense and Analytics Code in Your Development Environment on VuePress
- How to get VuePress latest pages from outside
- How to hide sidebar navigation if there is only a single item
- How to make moment.js lighter by execluding unused locale files
- How to create category and tag pages on VuePress
- How to construct a VuePress website