• Robert Knight's avatar
    Speed up PDF anchoring (#171) · ff8e000e
    Robert Knight authored
    When anchoring many annotations on a PDF, the text of the same page may
    be requested many times.
    
    The text is initially fetched via an async call to
    PDFViewerApplication.pdfViewer.getPageTextContent() and the result is
    then cached for future use.
    
    Previously the cache was only updated once this expensive call
    returned a result. Consequently when anchoring many annotations at once,
    there would be a lot of unnecessary cache misses and repeated calls to
    PDFViewerApplication.pdfViewer.getPageTextContent()
    
    Fix the problem by storing a promise for the result in the cache when
    the text for a given page is requested the first time. Consequently the
    text for each page will only be fetched once.
    ff8e000e
Name
Last commit
Last update
.github Loading commit data...
docs Loading commit data...
h Loading commit data...
images Loading commit data...
scripts Loading commit data...
.eslintignore Loading commit data...
.eslintrc Loading commit data...
.gitignore Loading commit data...
.npmignore Loading commit data...
.npmrc Loading commit data...
.travis.yml Loading commit data...
CHANGELOG.md Loading commit data...
CODE_OF_CONDUCT Loading commit data...
Jenkinsfile Loading commit data...
LICENSE Loading commit data...
Makefile Loading commit data...
README.md Loading commit data...
gulpfile.js Loading commit data...
npm-shrinkwrap.json Loading commit data...
package.json Loading commit data...