Performance 5x Slower PDFKit Document creation and unresponsive for CJK custom WOFF fonts.

Aperta
#1,469 2 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
35/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
javascript
Ambito
performance

Direzione di ricerca

Inizia riproducendo il caso di un PDF di una sola pagina con i font CJK WOFF collegati in PDFKit 0.12.10 su Node 18, confrontando il tempo di creazione e la reattività del browser con gli stessi font in formato TTF. Il lavoro è completato quando il rallentamento specifico di WOFF è stato identificato e risolto senza regressioni nella generazione normale dei font, e il comportamento è stato verificato in Chrome e Firefox.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Bug Report

Slow PDFKit Document creation and unresponsive, when WOFF type fonts are used.
No performance impact for the same font in TTF

Description of the problem

We are generating a text-only single-page PDF.
For languages Chinese, Hebrew & Japanese, we are making use of the below Google font in WOFF format downloaded from Google Webfonts helper.

Chinese - Noto Sans SC (1.5 MB) Download link Choose Historic support to get WOFF format.

Japanese / Hebrew - M PLUS 1p regular Download link Choose Historic support to get WOFF format.

For the above languages with the mentioned fonts, the pdf download takes around 8 seconds - 11 seconds for a single page.And it becomes unresponsive in Firefox. However, for other languages, it is way less ~ around 1 -2 seconds.

With TTF it works better without any issues

Note: Unable to upload woff font in GitHub. So shared the link from where I downloaded it.

Your environment

  • pdfkit version: 0.12.10
  • Node version: 18
  • Browser version (if applicable): Chrome Delay is seen but in Firefox it becomes unresponsive.
  • Operating System: Windows
Lingua principale
JavaScript
Stelle
10.7k
Fork
1.2k
Merge medio
21h 41m
PR unite (30g)
27

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di foliojs/pdfkit

Tutte le issue di foliojs/pdfkit

Issue simili

Altre issue su JavaScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.