Help: Take 150 seconds to parse

Open
#168 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
25/100
Issue type
Bug
Clarity
Needs clarification
Activity status
Stale
Tech stack
javascript

Research direction

No source files or tests are named. Start at PDFParser.loadPDF and getRawTextContent in the provided parsePdf entry point, then compare processing of the two linked PDFs while profiling the parser. Done means identifying and documenting the cause of the large timing difference, or narrowing it to a specific parsing stage.

Written by the indexing model from the issue text.

Description

I'm trying to process this document - http://imwerden.de/pdf/bocharov_roman_tolstogo_vojna_i_mir_1978__ocr.pdf and it takes +-150 seconds.

Why so long ? Speed depends on font type ?

Also similar size pdf (http://gsl.mit.edu/media/programs/south-africa-summer-2015/materials/0to1.pdf) processed for 5 seconds.

const parsePdf = (filePath) => {
  let pdfParserRawText = new PDFParser(this,1);
  pdfParserRawText.loadPDF(filePath);
  
  return new Promise((resolve, reject) => {
    pdfParserRawText.on('pdfParser_dataError', errData => {
      reject(new Error(errData.parserError));
    });
    pdfParserRawText.on('pdfParser_dataReady', pdfData => {
      const rawText = pdfParserRawText.getRawTextContent();
      resolve(rawText);
    });
  });
};
Dominant language
Java
Stars
2.2k
Forks
396
Avg merge
9d 19h
Merged PRs (30d)
3

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from modesty/pdf2json

All issues in modesty/pdf2json

Similar issues

More Java issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.