shd101wyy / vscode-markdown-preview-enhanced

One of the "BEST" markdown preview extensions for Visual Studio Code
https://shd101wyy.github.io/markdown-preview-enhanced
Other
1.44k stars 172 forks source link

PDF creation time of puppeteer #1339

Closed tmori3y2 closed 5 years ago

tmori3y2 commented 5 years ago

The PDF creation time of puppeteer is extremely slow from about 10-15 pages over. (Normally about 10 seconds will suddenly take 5 to 30 minutes)

Can you improve by increasing the buffer etc?

tmori3y2 commented 5 years ago

Some headless chrome processes have been launched, but each process only uses about 20 MB of memory and CPU usage is very high.

tmori3y2 commented 5 years ago

The sample is not immediately available as it is a confidential document.

The document has many Katex formulas, some UML / WaveDrom / Vega-lite diagrams, and page number footers.

Replacing the diagram with PNG does not improve it.

Although I tried to make PDF from the file which imported the .md files of MPE docs folder, the performance is not bad even if it exceeds 60 pages.

KaTex may be suspicious, but I will check it a little more.

tmori3y2 commented 5 years ago

Maybe the cause is my custom css.

A4_Slide_Numbering.zip

Dramatic slowdown with increasing number of child-doc.md imports.

tmori3y2 commented 5 years ago
shd101wyy commented 5 years ago

すみません、今日は中国端午の節句です、私は休みています。週末に帰ります!^_^

Haha I am learning Japanese now. Don’t know if I write it correctly.

I will be back this weekend, likely Sunday. Thank you!

tmori3y2 commented 5 years ago

Almost correct. Fix only one sentence;

私は休みています。-> 私は休んでいます。

日本の端午の節句は、5/5なので、1か月違いますね。:smile:

By the way, I suspected that the cause was the numbering of the header, but it was the reason that the div for the page break was made the closed empty element.

I used \<div style = "page-break-before: always" /> for page break which can be used by other parsers instead of \<!--pagebreak--> of MPE.

terrible slow when Chrome (Puppeteer)/PDF or Open in Browser (Chrome)/Print preview

fast (<2sec)

Chromium seems to be slow if div for page break is a closed empty element, so I will not use it.

Thanks a lot.

tmori3y2 commented 5 years ago

I reported this issue: https://bugs.chromium.org/p/chromium/issues/detail?id=990319