For some reason getSharePrice_1 became really quite slow a few days ago. Following a discussion we had here at the end of July I'd started using it in my spreadsheet. Currently the function is called for my 31 shares. It now takes eight minutes to get through them all; before it would be just a few seconds.
I've single-stepped through it and determined that the line causing the (new) delay is this one...
Code: Select all
Set theMatches = regexp.Execute(hrow.Cells(1).innerText)
A quick Google suggests that there might now be some catastrophic backtracking going on. If so, why this should have suddenly become worse is beyond me.
I have no experience with this regular expression function, regexp. Does anyone know why its behaviour might have changed and/or how I might speed it up again?
Thanks,
Chris
PS The regular expression it is using is:
Code: Select all
regexp.Pattern = "(\D?)(\d*,?\d*\.\d*)(.)"