Showing posts with label comparison. Show all posts
Showing posts with label comparison. Show all posts

Tuesday, June 10, 2008

quicksort java scala groovy

today i compared the running times of the quicksort algorithm implemented in java, scala and groovy. i took the scala implementation from 'Scala By Example' [available on scala-lang.org] and based on that i wrote the other two. i ran a test on an array of 1.000.000 integers. the algorithms were not optimized for each particular language [but i compiled the groovy file at least] and i don't really know if these results are quite representative. but anyway, here are the running times:

java: 280 ms
scala: 359 ms
groovy: 535250 ms