python - Jupyter notebook is extremely slow when re-running cells
问题描述
I have a relatively large Jupyter/Notebook (about 40GB of Pandas DFs in RAM). I'm running a Python 3.6 kernel installed with Conda.
I have about 115 cells that I'm executing. If I restart the kernel and run the cells, my whole notebook runs in about 3 minutes. If I re-run a simple cell that's not doing much work (i.e. a function definition), it takes an extremely long time to execute (~15 minutes).
I cannot find any documentation online that has Jupyer notebook installation best practices. My disk usage is low, available RAM is high and CPU load is very low.
My swap space does seem to be maxed out, but I'm not sure what would be causing this.
Any recommendations on troubleshooting a poor-performing Jupyter notebook server? This seems to be related to re-running cells only.
解决方案
如果变量检查器 nbextension 被激活,当内存中有大量变量(例如 Pandas 数据帧)时,它可能会减慢笔记本的速度。
见:https ://github.com/ipython-contrib/jupyter_contrib_nbextensions/issues/1275
如果是这种情况,请尝试在Edit -> nbextensions config
.
推荐阅读
- c++ - 将函数作为参数传递以避免重复代码
- oracle - APEX 5.1,在列链接中设置项目值不喜欢特殊字符...比如逗号或#
- python - 如何在 PyQt 中创建可折叠的盒子
- html - 快速一:放
在 ::before 部分 - vb.net - 图表点击事件不处理具有相同坐标 x 和 y 的两个数据点
- python - Pytest 奇怪的 ImportError
- sql-server - SQL Server Rank() 和分组依据
- python - Python中带有字符串的正则表达式
- docker - 如何使用 docker go-lang API 的 TaskLogs 端点?
- c# - 在 linq Select 语句中将文本组合在一起?