I've mentioned that MD5 hash calculation and then string comparison can be slow comparing to a precompiled regular expression search, but is that really true? Let me do some experiments and test the theory.
First I am going to run the application against the log file with over 4000 different exceptions and measure execution time. There are four types of exception in the file: several exceptions generated by the Tomcat engine, a few hundred Permission Denied exceptions, over a thousand File Not Found with the same file name, and over a thousand File Not Found with different filenames. The first number in the result indicates the total number of exceptions and the second is the total number of identified groups:
Was this article helpful?