资源说明:Some code to test the performance of the implementation of STM in Clojure
		
		
		
		
		
		
		* Status This is just a quick hack. I tried to come up with more sophisticated functions which would drive the STM machine into the various corners available. However, those functions I could come up with, which would do this in a repeatable, reliable way, would all use (Thread/sleep x) which lead to the benchmarks depending mainly on those sleep times. * How to run Note, that the projects calls Clojure 1.2.1 as its dependency. Usually I will use a Clojure compiled from the sources and run its very basic REPL with #+BEGIN_SRC bash java -cp path/to/my/compiled/clojure.jar:. clojure.main #+END_SRC from the top of this project. If you want to use a parallel garbage collector, you may want to try #+BEGIN_SRC bash java -cp path/to/my/compiled/clojure.jar:. -XX:+UseParallelGC clojure.main #+END_SRC However, on my machines a parallel GC gave only about 2% speedup. Then I ususally paste the functions from this project and look how they perform. Only the development of the functions is done with swank and slime. To load the complete benchmark suite you can issue #+BEGIN_SRC clojure (load-file "src/clj_stm_perf_test/core.clj") #+END_SRC If you want to run (almost) all function, use #+BEGIN_SRC clojure (clj-stm-perf-test.core/run-all) #+END_SRC * Oh my god, it's full of constants Yes, there is actually *lots* of seemingly magic numbers in there. All these were chosen so that the benchmark runs well on the machines that i have access to. Most importantly there were no visible improvements from HotSpot to spot anymore. * Further Reading Everyone loves to cite Mark Volkmans still valid article at [[http://java.ociweb.com/mark/stm/article.html]] however, I think we should add a recent Master's Thesis by Peder R. L. Nielsen and Patrick T. Kristiansen to the list of important resources for details on Clojure's STM: [[http://vbn.aau.dk/files/32587755/report.pdf]] These guys did an awesome job. * License Copyright (C) 2011 Stefan Kamphausen Distributed under the Eclipse Public License, the same as Clojure. See file COPYING.
					
									本源码包内暂不包含可直接显示的源代码文件,请下载源码包。
							
		
 English
