简体   繁体   English

如何停止评估一个大的repl结果导致slime与swank clojure减速?

[英]How to stop evaluation of a large repl result causing slime with swank clojure to slow down?

Whenever I evaluate a large value that prints a large datastructure into the repl, slime becomes very slow from then on. 每当我评估一个将大型数据结构打印到repl中的大值时,从那时起粘液变得非常慢。 Typing anything subsequently into the repl shows a delay in values appearing in the repl and further evaluation of any clojure code is slow. 随后在repl中键入任何内容会显示repl中出现的值的延迟,并且对任何clojure代码的进一步评估都很慢。 The only thing that seems to work is restarting the repl which doesn't seem like a solution. 似乎唯一有用的是重新启动repl,这似乎不是一个解决方案。

An simple example of a large datastructure is slurping a file and then printing it (this could even be a fairly small file). 大型数据结构的一个简单示例是啜饮文件然后打印它(这甚至可能是一个相当小的文件)。

This seems to happen both in Win7 and Ubuntu. 这似乎发生在Win7和Ubuntu中。

Any ideas on how to stop this and why it is happening would be appreciated! 关于如何阻止这种情况以及为什么会发生这种情况的任何想法都将不胜感激!

When I've run into this issue (which happens often), I simply clear the repl buffer. 当我遇到这个问题(经常发生)时,我只需清除repl缓冲区。 You can do this with Cc Mo, or by using "Clear Buffer" under the "REPL" menu item. 您可以使用Cc Mo或使用“REPL”菜单项下的“Clear Buffer”执行此操作。 This doesn't restart the repl, and command history and the like are unaffected. 这不会重新启动repl,并且命令历史记录等不受影响。

可以控制从REPL打印多少信息的一种方法是使用*print-length**print-level*变量从clojure本身。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM