I have a requirement like have to loop thru error logs and for each entry find a matching entry( using regular expressions) in access logs.
Since the access log(8 lakh lines) are huge compared to error log( 7 thousand lines) i do a reverse search , Loop thru access log once and for each of the entry find the closest match in the error log based on time and the error .
Initially the script took 12 hours , after several tuning like matching with timestamps skipping several entries in access log to attain the next error log entry etc the execution is boosted to 4 hours .
Is there is still any other way to reduce the time and boost the performance of the code?