1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-19 22:58:07 +02:00
pdf.js/src
Jonas Jenwald dbb82f05fc Re-factor the find helper function, in src/core/document.js, to search through the raw bytes rather than a string
During initial parsing of every PDF document we're currently creating a few `1 kB` strings, in order to find certain commands needed for initialization.
This seems inefficient, not to mention completely unnecessary, since we can just as well search through the raw bytes directly instead (similar to other parts of the code-base). One small complication here is the need to support backwards search, which does add some amount of "duplication" to this function.

The main benefits here are:
 - No longer necessary to allocate *temporary* `1 kB` strings during initial parsing, thus saving some memory.
 - In practice, for well-formed PDF documents, the number of iterations required to find the commands are usually very low. (For the `tracemonkey.pdf` file, there's a *total* of only 30 loop iterations.)
2019-12-14 13:43:26 +01:00
..
core Re-factor the find helper function, in src/core/document.js, to search through the raw bytes rather than a string 2019-12-14 13:43:26 +01:00
display [api-minor] Move the ReadableStream polyfill to the global scope 2019-12-11 19:02:37 +01:00
images Vectorize the logo. 2012-10-29 14:08:52 -04:00
shared [api-minor] Move the ReadableStream polyfill to the global scope 2019-12-11 19:02:37 +01:00
doc_helper.js [api-major] Completely remove the global PDFJS object 2018-03-01 18:13:27 +01:00
interfaces.js Consistently use @type for getter data types in JSDoc comments 2019-10-13 13:58:17 +02:00
license_header.js Update the year in the license_header files 2019-02-24 00:35:42 +01:00
license_header_libre.js Update the year in the license_header files 2019-02-24 00:35:42 +01:00
pdf.image_decoders.js Add a gulp image_decoders command to allow packaging/distributing the image decoders (i.e. jpg.js, jpx.js, jbig2.js) separately from the main PDF.js library 2018-06-16 17:56:54 +02:00
pdf.js [api-minor] Move the ReadableStream polyfill to the global scope 2019-12-11 19:02:37 +01:00
pdf.worker.entry.js Rename the globals to shorter names. 2018-03-16 11:08:56 -07:00
pdf.worker.js Stop bundling the ReadableStream polyfill in MOZCENTRAL builds (PR 10470 follow-up) 2019-01-23 20:33:20 +01:00
worker_loader.js Moves global scope out of shared/util. 2017-08-22 18:20:52 -05:00