Questions tagged «garbage-collect»

1
将gc-cons-threshold设置得很高并在闲置时收集垃圾有任何不利之处吗?
我在我的顶部添加了以下两行init.el: (setq gc-cons-threshold (eval-when-compile (* 1024 1024 1024))) (run-with-idle-timer 2 t (lambda () (garbage-collect))) 这意味着Emacs不会在闲置时(即当暂停不打扰我时)这样做,而不是每分配800KB的内存收集垃圾。(它还会在分配1GB内存后收集,但我认为不会发生这种情况)。 这将我的启动时间缩短了大约三分之二。从理论上讲,它还应该总体上提高性能。这种方法有不利之处吗?
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.