Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MathJax causing unusual hanging in large notebooks #28257

Closed
embray opened this issue Jul 25, 2019 · 4 comments
Closed

MathJax causing unusual hanging in large notebooks #28257

embray opened this issue Jul 25, 2019 · 4 comments

Comments

@embray
Copy link
Contributor

embray commented Jul 25, 2019

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.

CC: @evansdoe @egourgoulhon

Component: notebook

Keywords: days102

Issue created by migration from https://trac.sagemath.org/ticket/28257

@embray embray added this to the sage-8.9 milestone Jul 25, 2019
@embray
Copy link
Contributor Author

embray commented Dec 30, 2019

comment:2

Ticket retargeted after milestone closed

@embray embray modified the milestones: sage-8.9, sage-9.1 Dec 30, 2019
@mkoeppe
Copy link
Contributor

mkoeppe commented May 1, 2020

comment:3

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

@mkoeppe mkoeppe modified the milestones: sage-9.1, sage-9.2 May 1, 2020
@mkoeppe mkoeppe modified the milestones: sage-9.2, sage-9.3 Oct 24, 2020
@mkoeppe
Copy link
Contributor

mkoeppe commented Mar 24, 2021

comment:5

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.

@mkoeppe mkoeppe modified the milestones: sage-9.3, sage-9.4 Mar 24, 2021
@mkoeppe mkoeppe modified the milestones: sage-9.4, sage-9.5 Aug 9, 2021
@mkoeppe mkoeppe modified the milestones: sage-9.5, sage-9.6 Dec 18, 2021
@mkoeppe mkoeppe modified the milestones: sage-9.6, sage-9.7 May 3, 2022
@mkoeppe mkoeppe modified the milestones: sage-9.7, sage-9.8 Sep 19, 2022
@mkoeppe mkoeppe removed this from the sage-9.8 milestone Jan 29, 2023
@kwankyu
Copy link
Collaborator

kwankyu commented Aug 24, 2023

The first notebook does not open, with message

Unreadable Notebook: .../sage_days_102_introduction_to_sagemath.ipynb NotJSONError("Notebook does not appear to be JSON: '\\n\\n\\n\\n\\n\\n<!DOCTYPE html>\\n<html lang...")

and the second notebook opens well though it takes some time to render all equations.

This is jupyterlab 3.5.3 and its classic version.

Hence the problems in the description do not appear anymore. At least I think there is nothing to do on our side. I am closing this issue.

@kwankyu kwankyu closed this as completed Aug 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants