Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Halve the size of the PageView cache. #4937

Merged
merged 1 commit into from

2 participants

@nnethercote

The PageView cache currently has a max size of 20. That seems overly generous. This patch reduces it to 10.

On my MacBook with a retina screen, the canvas for each page is typically about 22 MiB, so this reduces peak memory usage by 10 x 22 = 220 MiB. On my Linux desktop it's about 5.5 MiB per page, so it saves 10 x 5.5 = 55 MiB.

@yurydelendik

Yeah, I wanted to do that long ago too.

@yurydelendik yurydelendik merged commit 7377598 into from
@nnethercote

Thanks for all the fast responses you've given me in the past 24 hours! :)

@nnethercote nnethercote deleted the branch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jun 13, 2014
  1. @nnethercote
This page is out of date. Refresh to see the latest.
Showing with 1 addition and 1 deletion.
  1. +1 −1  web/viewer.js
View
2  web/viewer.js
@@ -28,7 +28,7 @@ var DEFAULT_URL = 'compressed.tracemonkey-pldi-09.pdf';
var DEFAULT_SCALE = 'auto';
var DEFAULT_SCALE_DELTA = 1.1;
var UNKNOWN_SCALE = 0;
-var CACHE_SIZE = 20;
+var CACHE_SIZE = 10;
var CSS_UNITS = 96.0 / 72.0;
var SCROLLBAR_PADDING = 40;
var VERTICAL_PADDING = 5;
Something went wrong with that request. Please try again.