IntroductionThe burstsort4j library includes a benchmark harness that runs the various sort implementations over several different sets of data, each of varying sizes. The purpose is to compare the sort implementations to each other, hopefully showing that burstsort is often much faster than the other typical sorts. DetailsBenchmarks with Generated DataThe machine for running the benchmarks should have at least 1 GB of RAM for this to work at all, ideally 2 GB or more. Anything less and you really should stick with the 333k line test described below. # Build the jar: ant dist # Run the benchmark: java -Xmx1024m -cp dist/burstsort4j.jar org.burstsort4j.Benchmark This will generate different data sets in three different sizes and run each of the sort implementations on them. For each test, the generated and shuffled data is copied to a new array, ensuring that each sort sees the exact same data. Each sort is run several times and an average running time is calculated. Benchmarks with a FileTo benchmark using a particular data file, add two more options. The first option specifies the input size: --1 : 333,000 lines
--2 : 1,000,000 lines
--3 : 3,000,000 lines Specifying --3 will also test the smaller sizes as well, and using --2 will test the 333k and 1m sizes. The second option is the file name (and optional path) for the test data, which should contain a sufficient number of lines for the given data size (i.e. 3m lines if using --3). Specific BenchmarksWith the --parallel option, the Benchmark class will run the single-threaded and multi-threaded versions of burstsort. Meanwhile the --burstsort option runs just the single-threaded burstsort sorts and none of the others.
|