Multithreaded Sorting Algorithm Optimization
An experimental desktop application that races eight sorting algorithms on the same data using threads and compares measured completion times.
This project was an experimental desktop application in which I ran eight sorting algorithms over the same input and compared their results and completion times. In the original implementation, algorithms were started on separate threads and treated as competitors in a race.
Experiment Structure
The application could generate random values or use values supplied by the user. Equivalent starting data was passed to the sorting functions, elapsed time was measured with Stopwatch, and a correctly sorted result was displayed through the interface.
The concurrent race was useful for visualizing relative algorithm behavior, but it did not produce an isolated and repeatable benchmark.
A Thread Race Is Not an Isolated Benchmark
Running several sorting algorithms simultaneously means that their measured times are not independent. The operating-system scheduler, CPU core count, caches and memory bandwidth allow the competitors to influence one another.
For that reason, "the first thread to finish" cannot be generalized into "the universally fastest sorting algorithm." A controlled benchmark should use equivalent input distributions, repeated runs and isolation appropriate to the measurement target.
That retrospective distinction is one of the useful lessons of the project: measurement design is part of performance engineering.
Algorithmic Context
The sorting algorithms and their complexity belong to my Data Structures and Algorithm Analysis notes. The effect of scheduling and processor behavior is covered more broadly in Operating Systems and Computer Architecture.