lldb.frame.EvaluateExpression slows down when called a lot

I am sorry for responding to my own thread. I found a workaround. Would like to share it here in case someone else would stomp on the same issue.

I changed my script to read data using process.ReadMemory into python variables and do the comparison in python instead of calling 'memcmp' via EvaluateExpression. It proved to be much faster even though I compare up to a few megabytes sized arrays. My guess is that even though "memcmp" compares faster than python, the overhead with EvaluateExpression is so big that it makes comparison in python a winner. And a huge bonus is that there is no degradation in performance after using process.ReadMemory many times.

Summary: EvaluateExpression still has an issue. It gets slower with each call. If possible try to avoid using it. If still need to use, try to do it less. The slowness comes after a few hundreds of calls.