startTick := A_TickCount
a := A_IPAddress1
OutputDebug("Execution time = " (A_TickCount - startTick) "ms")
; Execution time = 3890ms
After several hours of debugging, I isolated a major performance bottleneck in my code to a line that was accessing A_IPAddress1.
Use case: I was analyzing logged TCP traffic, checking IP values in each packet against A_IPAddress1 to determine the source/destination. It was taking several minutes to process just a few thousands lines of logged traffic.
I'm guessing AHK is looking up this IP address every time it's accessed. Does AHK cache any of it's built-in variables internally after they are first retrieved? If so, would it make sense to cache A_IPAddress1-4?