What gotcha's exist when working with transient in Clojure 1.3?

 ̄綄美尐妖づ 提交于 2019-12-24 08:24:32

问题


I'm looking into techniques to speed up my application and I'm trying out Transients. I know I'm supposed to treat them with some caution, but what are the kinds of issues that arise?

Any advice would be appreciated!


回答1:


Use transients like the usual persistent data structures - that is, always use the return value from a mutator instead of the structure you called the mutator on. However, don't trust that the old version stays the same, and don't access transients from other threads.



来源:https://stackoverflow.com/questions/8971675/what-gotchas-exist-when-working-with-transient-in-clojure-1-3

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!