Python 如何让 Pycharm 更快/更轻?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/38242978/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-19 20:32:59  来源:igfitidea点击:

How to make Pycharm faster/lighter?

pythonidepycharm

提问by T.Lipperz

I really dig the idea of Pycharm and would love to use it. However, its tendency to consume the computer's processing power and lag is a large drawback.

我真的很喜欢 Pycharm 的想法并且很想使用它。然而,它倾向于消耗计算机的处理能力和滞后是一个很大的缺点。

In the near future, I'll be running an introductory Python course and would like to recommend that the students install Pycharm as it seems to be the friendliest IDE out there.

在不久的将来,我将开设一门 Python 入门课程,并建议学生安装 Pycharm,因为它似乎是目前最友好的 IDE。

Is there a way to speed up Pycharm to make its processing a bit 'lighter'? Or is there an alternative IDE with similar features that people would recommend?

有没有办法加快 Pycharm 的处理速度,使其处理更“轻”一些?或者是否有人们推荐的具有类似功能的替代 IDE?

采纳答案by All ?? Vаи?тy

The slow performance of PyCharm is mainly due to small amount of RAM. I am running PyCharm on a machine with 2GB RAM. Here are my recommendations on making it work smoother.

PyCharm 的性能缓慢主要是由于 RAM 量小。我在具有 2GB RAM 的机器上运行 PyCharm。以下是我关于使其工作更顺畅的建议。

  1. You can't really tweak PyCharm for performancebalancing the power it provides. If you turn off the inspection or works on Power Saver Mode, You won't get code completion unless you manually invoke it with Ctrl+ Space.

  2. Switch to a lighter Operating System. (If you are a Linux person you have a plenty of choices.)

  3. Monitor other System processes. (I was able to bring down standby memory usage of Kubuntu to less than 300MB by disabling other 'useless' processes that eat up memory)

  4. Disable unused plugins in PyCharm.

  5. Modern browsers are memory hungry. Limit number of tabs and plugins (even Adblock consumes around 70MB RAM) if you open docs on brower while you code.

  6. Update your hardware. (This really helps. Invest on RAM so you can ignore the points above)

  1. 您无法真正调整 PyCharm平衡其提供的功能的性能。如果您关闭检查或继续工作Power Saver Mode,除非您使用Ctrl+手动调用它,否则您将无法完成代码Space

  2. 切换到更轻的操作系统。(如果你是一个 Linux 人,你有很多选择。)

  3. 监视其他系统进程。(通过禁用其他消耗内存的“无用”进程,我能够将 Kubuntu 的待机内存使用量降低到 300MB 以下)

  4. 在 PyCharm 中禁用未使用的插件。

  5. 现代浏览器是内存饥渴。如果您在编写代码时在浏览器上打开文档,则限制选项卡和插件的数量(即使是 Adblock 也消耗大约 70MB RAM)。

  6. 更新您的硬件。(这真的很有帮助。投资 RAM,这样你就可以忽略上面的几点)

WingIDEis an another IDE that works somewhat similar to PyCharm.

WingIDE是另一个与 PyCharm 有点类似的 IDE。

回答by Chad Hamilton Frederick

PyCharm is written in Java, and Java uses Just In Time compiling i.e. a method in Java bytecode is converted to native code the first time that method is called. The next time that method is called it runs much faster.

PyCharm 是用 Java 编写的,Java 使用即时编译,即 Java 字节码中的方法在第一次调用该方法时被转换为本机代码。下次调用该方法时,它运行得更快。

So, the first thing you should do with a new installation of PyCharm is run it a few times and try some of the basic features. Be sure to open and close PyCharm a few times as well. I find that this helps everytime I install a new version of PyCharm.

因此,对于新安装的 PyCharm,您应该做的第一件事是运行几次并尝试一些基本功能。一定要打开和关闭 PyCharm 几次。我发现每次安装新版本的 PyCharm 时这都会有所帮助。

回答by voy

First of all: you can disable inspections. In right bottom, on status bar, next to memory usage indicator, there is a little Hector head - click it and select "syntax" level. I belive this will help a lot.

首先:您可以禁用检查。在右下角,在状态栏上,在内存使用指示器旁边,有一个小赫克托头 - 单击它并选择“语法”级别。我相信这会很有帮助。

If this won't help enough you can set "Power save mode". From PyCharm help:

如果这还不够,您可以设置“省电模式”。来自PyCharm 的帮助

When Power Save Mode is on, PyCharm reduces its functionality to the one of a text editor, by not executing expensive background activities that drain laptop battery.

当省电模式打开时,PyCharm 将其功能减少为文本编辑器之一,因为它不执行消耗笔记本电脑电池的昂贵后台活动。

回答by Sean Francis N. Ballais

In the hardware end, upgrading your system is a fair choice. PyCharm recommends 1 GB of RAM as stated in the system requirementsat the PyCharm website.

在硬件方面,升级您的系统是一个公平的选择。PyCharm 建议使用 1 GB RAM,如PyCharm 网站上的系统要求中所述。

You could disable a few of PyCharm's functionalities like disabling inspections. You could also turn on "Power Save Mode" for PyCharm.

您可以禁用一些 PyCharm 的功能,例如禁用检查。您还可以为 PyCharm 开启“省电模式”。

You could also use a lighter operating system when running PyCharm, or kill a few processes to reduce the load of the computer.

您也可以在运行 PyCharm 时使用更轻的操作系统,或者杀死一些进程以减少计算机的负载。

If PyCharm is still heavy for you, you could try out Python for VS Code, KDevelop, or you could go use a text editor such as Atomfor Python development. Here's a full listof Python IDEs.

如果 PyCharm 对你来说仍然很重,你可以尝试Python for VS CodeKDevelop,或者你可以使用文本编辑器,例如Atom进行 Python 开发。这是 Python IDE的完整列表