问题
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