Use a profiler to check where your program spends the most time.