Opened 2 years ago

Last modified 6 weeks ago

#28257 new defect

MathJax causing unusual hanging in large notebooks

Reported by: embray Owned by:
Priority: major Milestone: sage-9.5
Component: notebook Keywords: days102
Cc: gh-evansdoe, egourgoulhon Merged in:
Authors: Reviewers:
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Status badges

Description

A problem we kept having at Sage Days 102 is that one of the instructors created a (very good) tutorial notebook for Sage that is quite long, and simply opening it would cause users' web browsers to hang, possibly for several minutes on slower machines.

It has since (because of this problem, in part) been broken up into several smaller notebooks, but you can see the original large notebook here:

https://github.com/gabayae/sage-days-102/blob/a8bfb27528540116b8d17726d283a28a66200005/sage_days_102_introduction_to_sagemath.ipynb

This would hang on Firefox and Chrome (in both cases going so slowly that the browser will interrupt execution several times and prompt the user to either wait, or permanently halt execution of the script, at which point Latex rendering stops working, and sometimes the page doesn't finish loading).

I've also observed this problem on some other large-ish notebooks such as https://raw.githubusercontent.com/sagemanifolds/SageManifolds/master/Notebooks/SM_sphere_S2.ipynb

Yes, MathJax can be slow at times, but it's supposed to lazily do typesetting in the background once the page has loaded. However, in this case, it seems to be hanging the whole page before the DOM is even fully loaded.

While this is happening, MathJax displays a message in the corner of the page of Loading [MathJax]/extensions/Safe.js. So whatever this Safe.js extension is, it seems to cause serious problems on large notebooks.

Furthemore, the notebook we were having problems with doesn't actually have that many equations in it, so it's not a problem of slow rendering. I actually extracted all the equations from the notebook and pasted them into a single cell, and it renders almost immediately. The problem seems to have more to do with just the size of the HTML page.

Change History (6)

comment:1 Changed 2 years ago by egourgoulhon

  • Cc egourgoulhon added

comment:2 Changed 21 months ago by embray

  • Milestone changed from sage-8.9 to sage-9.1

Ticket retargeted after milestone closed

comment:3 Changed 17 months ago by mkoeppe

  • Milestone changed from sage-9.1 to sage-9.2

Moving tickets to milestone sage-9.2 based on a review of last modification date, branch status, and severity.

comment:4 Changed 11 months ago by mkoeppe

  • Milestone changed from sage-9.2 to sage-9.3

comment:5 Changed 6 months ago by mkoeppe

  • Milestone changed from sage-9.3 to sage-9.4

Sage development has entered the release candidate phase for 9.3. Setting a new milestone for this ticket based on a cursory review of ticket status, priority, and last modification date.

comment:6 Changed 6 weeks ago by mkoeppe

  • Milestone changed from sage-9.4 to sage-9.5
Note: See TracTickets for help on using tickets.