This project benchmarks the performance and energy usage of four core sorting algorithms implemented in Java: Bubble Sort, Merge Sort, Quick Sort, and Counting Sort.
The goal was to evaluate both runtime complexity and energy consumption, using a controlled experimental setup and system-level power measurement tools.
This project was completed as part of a university assignment at University College Dublin.
Simple but inefficient; used as baseline comparison.
Stable, divide-and-conquer algorithm with consistent performance.
Fastest algorithm in most scenarios (randomized pivot).
Linear-time sorting for bounded integer ranges.
- Inputs tested under:
- Sorted (best case)
- Reverse sorted (worst case)
- Random integers
- Input sizes up to 500,000 elements
- Hardware:
- ASUS Vivobook
- AMD Ryzen 7 5700U
- Energy measurement tools:
- HWINFO64 (GPU & CPU wattage sampling)
- Each test repeated between 10β30 times for consistency
The poster highlights:
- Time complexity comparison
- Energy usage across all algorithms
- Large-scale performance charts
- Key findings and conclusions
/src
BubbleSort.java
MergeSort.java
QuickSort.java
CountingSort.java
GenerateCSV.java
Main.java
README.md
Each algorithm is implemented clearly and tested using a CSV-based output system for chart plotting.
Clone the repository:
git clone cd
Compile:
javac src/*.java
Run benchmark:
java -cp src Main
This will generate CSV files containing runtime results for analysis and plotting.
- Quick Sort was the fastest AND most energy-efficient overall
- Merge Sort performed consistently well across all input types
- Counting Sort was efficient, but energy usage varied noticeably
- Bubble Sort consumed the most time and energy by a large margin
- Strong correlation observed between time complexity and energy consumption
This project demonstrates:
- Practical algorithm performance evaluation
- Understanding of asymptotic complexity
- Benchmark design and measurement
- Energy-aware computing concepts
- Clean, modular Java implementation
It is ideal for:
- Interview preparation
- Understanding real-world algorithm behaviour
- Learning how energy usage correlates with computational complexity
