Open badicsalex opened 2 years ago
BTW, there are a lot of duplicate entries in the map.
Can confirm that the suggested fix vastly improves speed. For a sample size of 60 PDFs, with most of them being multiple pages long, simply extracting text from them took 27 seconds.
After implementing this fix, and the one suggested in issue 33 my run time went down to 1 second. Highly recommend.
Is it possible for you to share that or a similar document?
Here's a long one that's pretty good for benchmarking: http://www.kozlonyok.hu/nkonline/MKPDF/hiteles/MK13031.pdf
And a short one to benchmark font parsing: http://www.kozlonyok.hu/nkonline/MKPDF/hiteles/MK20058.pdf
I have a very accent-heavy hungarian document I'm parsing, and 95% of the processing time was spent in
name_to_unicode
Please consider using a HashMap or, even better, a compile-time perfect hash function. Example patch here: https://github.com/badicsalex/pdf-extract-fhl/commit/5cb9b67