pdf.js/src/core
Jonas Jenwald 62a9c26cda Always prefer the PDF.js JPEG decoder for very large images, in order to reduce peak memory usage (issue 11694)
When JPEG images are decoded by the browser, on the main-thread, there's a handful of short-lived copies of the image data; see c3f4690bde/src/display/api.js (L2364-L2408)
That code thus becomes quite problematic for very big JPEG images, since it increases peak memory usage a lot during decoding. In the referenced issue there's a couple of JPEG images whose dimensions are `10006 x 7088` (i.e. ~68 mega-pixels), which causes the *peak* memory usage to increase by close to `1 GB` (i.e. one giga-byte) in my testing.

By letting the PDF.js JPEG decoder, rather than the browser, handle very large images the *peak* memory usage is considerably reduced and the allocated memory also seem to be reclaimed faster.

*Please note:* This will lead to movement in some existing `eq` tests.
2020-03-20 16:37:19 +01:00
..
annotation.js Enable the ESLint prefer-const rule globally (PR 11450 follow-up) 2020-01-25 00:20:22 +01:00
arithmetic_decoder.js Enable auto-formatting of the entire code-base using Prettier (issue 11444) 2019-12-26 12:34:24 +01:00
bidi.js Enable the no-nested-ternary ESLint rule (PR 11488 follow-up) 2020-01-14 17:49:39 +01:00
ccitt_stream.js Enable the ESLint prefer-const rule globally (PR 11450 follow-up) 2020-01-25 00:20:22 +01:00
ccitt.js Enable the ESLint prefer-const rule globally (PR 11450 follow-up) 2020-01-25 00:20:22 +01:00
cff_parser.js Enable the ESLint prefer-const rule globally (PR 11450 follow-up) 2020-01-25 00:20:22 +01:00
charsets.js Enable auto-formatting of the entire code-base using Prettier (issue 11444) 2019-12-26 12:34:24 +01:00
chunked_stream.js Enable the ESLint prefer-const rule globally (PR 11450 follow-up) 2020-01-25 00:20:22 +01:00
cmap.js Allow skipping of errors when reading broken/corrupt ToUnicode data (issue 11549) 2020-01-30 13:19:05 +01:00
colorspace.js Enable the prefer-exponentiation-operator ESLint rule 2020-03-19 12:41:25 +01:00
core_utils.js Rename the isSpace helper function to isWhiteSpace 2020-03-12 11:36:59 +01:00
crypto.js Fix remaining linting errors, from enabling the prefer-const ESLint rule globally 2020-01-25 00:20:23 +01:00
document.js Rename the isSpace helper function to isWhiteSpace 2020-03-12 11:36:59 +01:00
encodings.js Enable auto-formatting of the entire code-base using Prettier (issue 11444) 2019-12-26 12:34:24 +01:00
evaluator.js Don't accidentally accept invalid glyphNames which *appear* to follow the Cdd{d}/cdd{d} format in PartialEvaluator._buildSimpleFontToUnicode (issue 11697) 2020-03-13 23:35:47 +01:00
font_renderer.js Fix remaining linting errors, from enabling the prefer-const ESLint rule globally 2020-01-25 00:20:23 +01:00
fonts.js Enable the prefer-exponentiation-operator ESLint rule 2020-03-19 12:41:25 +01:00
function.js Enable the prefer-exponentiation-operator ESLint rule 2020-03-19 12:41:25 +01:00
glyphlist.js Ensure that all import and require statements, in the entire code-base, have a .js file extension 2020-01-04 13:01:43 +01:00
image_utils.js Add basic validation of the scanLines parameter in JPEG images, before delegating decoding to the browser 2020-02-22 14:16:07 +01:00
image.js Enable the ESLint prefer-const rule globally (PR 11450 follow-up) 2020-01-25 00:20:22 +01:00
jbig2_stream.js Enable the ESLint prefer-const rule globally (PR 11450 follow-up) 2020-01-25 00:20:22 +01:00
jbig2.js Move additional worker-thread only functions from src/shared/util.js and into a src/core/core_utils.js instead 2020-01-25 00:33:52 +01:00
jpeg_stream.js Always prefer the PDF.js JPEG decoder for very large images, in order to reduce peak memory usage (issue 11694) 2020-03-20 16:37:19 +01:00
jpg.js Add a heuristic, in src/core/jpg.js, to handle JPEG images with a wildly incorrect SOF (Start of Frame) scanLines parameter (issue 10880) 2020-02-22 14:16:07 +01:00
jpx_stream.js Enable the ESLint prefer-const rule globally (PR 11450 follow-up) 2020-01-25 00:20:22 +01:00
jpx.js Enable the prefer-exponentiation-operator ESLint rule 2020-03-19 12:41:25 +01:00
metrics.js Ensure that all import and require statements, in the entire code-base, have a .js file extension 2020-01-04 13:01:43 +01:00
murmurhash3.js Ensure that all import and require statements, in the entire code-base, have a .js file extension 2020-01-04 13:01:43 +01:00
obj.js [api-minor] Add more general OpenAction support (PR 10334 follow-up, issue 11642) 2020-03-06 13:03:00 +01:00
operator_list.js Ensure that all import and require statements, in the entire code-base, have a .js file extension 2020-01-04 13:01:43 +01:00
parser.js Enable the prefer-exponentiation-operator ESLint rule 2020-03-19 12:41:25 +01:00
pattern.js Enable the ESLint prefer-const rule globally (PR 11450 follow-up) 2020-01-25 00:20:22 +01:00
pdf_manager.js Ensure that all import and require statements, in the entire code-base, have a .js file extension 2020-01-04 13:01:43 +01:00
primitives.js Slightly simplify the lookup of data in Dict.{get, getAsync, has} 2020-03-06 14:12:14 +01:00
ps_parser.js Rename the isSpace helper function to isWhiteSpace 2020-03-12 11:36:59 +01:00
standard_fonts.js Use the same non-embedded Wingdings fallback for fonts named "Wingdings-Regular" too (PR 5463 follow-up, issue 11451) 2020-02-24 17:40:06 +01:00
stream.js Rename the isSpace helper function to isWhiteSpace 2020-03-12 11:36:59 +01:00
type1_parser.js Rename the isSpace helper function to isWhiteSpace 2020-03-12 11:36:59 +01:00
unicode.js Ensure that all import and require statements, in the entire code-base, have a .js file extension 2020-01-04 13:01:43 +01:00
worker_stream.js Ensure that all import and require statements, in the entire code-base, have a .js file extension 2020-01-04 13:01:43 +01:00
worker.js [api-minor] Add more general OpenAction support (PR 10334 follow-up, issue 11642) 2020-03-06 13:03:00 +01:00