You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#1673 is an example of an enormous file size we didn't realize. That has two major downsides:
Makes the site slower for users to access, especially when they have slow Internet
Slows down next.js's build process
I think #1672 may help address this. But either way, we may want to add a check that file sizes don't cross a threshold, e.g. >400MB. This would be at least for Jupyter notebooks, but maybe also for dedicated image files.
The allowlist mechanism should set new thresholds, e.g. (my-file.ipynb, 600) to set a threshold of 600MB.
FYI: how to reduce Jupyter notebook image size
Often PNGs are smaller than SVGs:
# Don't use SVGs for this file because the images are too large,
# and the SVGs are much larger than their PNGs equivalents.
%config InlineBackend.figure_format='png'
You can reduce the resolution of Matplotlib figures. However, this often makes the image less useful and I think it tends to be better to instead set figsize:
You can sometimes set figsize directly in Qiskit SDK:
# We set `figsize` to a smaller size to make the documentation website faster# to load. Normally, you do not need to set the argument.plot_gate_map(backend, figsize=(4, 4))
If figsize is not exposed, then you can change the returning figure:
Note that unless the SVG is is significantly bigger than its PNG equivalent, it may still load faster for users. SVGs can be compressed a lot when sent over the network, whereas PNGs are already compressed so the file size we see is much closer to what's actually sent.
#1673 is an example of an enormous file size we didn't realize. That has two major downsides:
I think #1672 may help address this. But either way, we may want to add a check that file sizes don't cross a threshold, e.g. >400MB. This would be at least for Jupyter notebooks, but maybe also for dedicated image files.
The allowlist mechanism should set new thresholds, e.g.
(my-file.ipynb, 600)
to set a threshold of 600MB.FYI: how to reduce Jupyter notebook image size
Often PNGs are smaller than SVGs:
You can reduce the resolution of Matplotlib figures. However, this often makes the image less useful and I think it tends to be better to instead set
figsize
:You can sometimes set
figsize
directly in Qiskit SDK:If
figsize
is not exposed, then you can change the returning figure:One of the other techniques is to see if any of the images can be removed entirely. Are they pulling their weight?
The text was updated successfully, but these errors were encountered: