by simonw · 4y ago · 0 comments
It really is astonishing that they've managed to get the full data science Python stack - a lot of it based around custom C extensions (numpy, Pandas etc) running entirely in the browser.
https://scleox.github.io/constrained-particle-system-simulat...
In a JupyterLyte notebook:
import numpy as np
a = np.random.randn(128,128)
b = np.random.randn(128,128)
%timeit a @ b
1.5 ms ± 3.3 µs per loop (mean ± std. dev. of 7 runs, 1,000 loops each)
On my command line: $ python3 -m timeit --setup 'import numpy as np; a = np.random.randn(128,128); b = np.random.randn(128,128)' 'a @ b'
5000 loops, best of 5: 59.4 usec per loopVSCode, Atom (and Jupyter) all run natively, only using a browser renderer for UI.
Jupiter already uses a browser as the front end, but the kernel runs natively.
JupiterLite runs entirely in the browswer, including the kernel. This means you don't need Jupyter installed or running on a server to execute the kernel. But it also means the kernel is running much slower in Web Assembly.
python command line 247µs
local jupyter lab 274µs
jupyter lite 4ms (about 16 times slower than the other two)
Honestly considering how jupyter lite is working, I still feel this is pretty good.I do not care about the performance of jupyer lite - that it runs at all is a miracle. That it is acceptable performance for doing demos/teaching from a browser is simply magic.
I am seeing about 50-60MB resource usage which is fantastic considering that includes pandas, numpy, sklearn and some other non standard modules.
By comparison when I tried to package a hello world pandas project with PyInstaller the single file exe for Windows came out to 500MB.
Nope. Locked down like a crab's arse.
Sad. The Chromebook went under his bed, and came back out at the end of the school year when it had to be returned.