I wrote an application to analyze a log file using haskell. When I run it with the same log file, sometimes it costs 30s, and sometimes costs 20s, the execution time differs by up to 10 seconds.
why is there such a large difference in running time?
I wrote an application to analyze a log file using haskell. When I run it with the same log file, sometimes it costs 30s, and sometimes costs 20s, the execution time differs by up to 10 seconds.
why is there such a large difference in running time?
The difference is more than likely caused by other processes that are running at the same time on the system.
Try separating the processing time from the file-access time.
Read the entire file into memory, track that time, then process the data in your storage strucutres and track that time separately.
My gut instinct is that the file access is the random contriubtor. Gut instinct is not a good substitution for a profiler.