[annotator-dev] Problem with 1.2.x performance on long documents

Greg Pendlebury greg.pendlebury at gmail.com
Wed Dec 2 02:05:11 UTC 2015

We found another major performance problem was in the '_setupDynamicStyle'
method (1.2.10), or 'injectDynamicStyle' against the current head. The
selector which loads up every non-annotator node in the entire document in
order to find the largest z-index.

I just wrapped an if test around options and let the user send an arbitrary
z-index in with the options. In our particular use case this is fine and
shaved a few seconds off the page load times.


On 18 November 2015 at 05:19, Michael Widner <mikewidner at stanford.edu>

> Thanks to a similar issue in the 2.x branch that's already been fixed and
> Randall's guidance, I was able back-port the fix to the 1.2.x branch:
> https://github.com/openannotation/annotator/pull/577
> My testing shows that these changes made a massive difference in
> performance.
> Best,
> Mike
> On 11/16/15 4:27 PM, Michael Widner wrote:
>> Hi all,
>> I've discovered that when loading annotations on a long document (think:
>> a novel), the performance degrades so severely that it becomes unusable for
>> many people. For me, the test I'm looking at takes 16 full seconds to
>> finish setting up annotations. The offending call happens at from
>> Util.getTextNodes().
>> The problem, if I'm understanding it correctly, is that it's having to
>> walk the entire, very large DOM searching for all the text nodes. Has
>> anyone else tried running Annotator on a long text? If so, did you find any
>> work-arounds for the performance problem? Without rewriting the involved
>> routines, the only solution I can think of is to only load annotations on
>> the visible screen, but that's also a significant change.
>> I'd very much appreciate any ideas or help.
>> Thanks,
>> Mike
> _______________________________________________
> annotator-dev mailing list
> annotator-dev at lists.okfn.org
> https://lists.okfn.org/mailman/listinfo/annotator-dev
> Unsubscribe: https://lists.okfn.org/mailman/options/annotator-dev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.okfn.org/pipermail/annotator-dev/attachments/20151202/a2d65e10/attachment-0003.html>

More information about the annotator-dev mailing list