Re: Why does SET performance degrade as environment size grows?
Posted: 24 Sep 2016 22:16
This large memory issue cropped up again. I ran into a massive performance degradation problem while working on a StackOverflow question - http://stackoverflow.com/a/39672776/1012053. Within a loop of 1000, I was creating hundreds of variables between SETLOCAL and ENDLOCAL. The performance was totally non-linear, to the point of quickly becoming unusable.
I believe I have made a significant new discovery related to environment memory management. We had been thinking that the environment never shrinks. But I discovered that I could get the environment to shrink if I put the SETLOCAL, massive allocation, and ENDLOCAL within a CALLed subroutine, or within a new cmd.exe process. The new process wasn't much of a surprise, but the CALL solution was.
I haven't had time to fully investigate, but this looks promising.
Dave Benham
I believe I have made a significant new discovery related to environment memory management. We had been thinking that the environment never shrinks. But I discovered that I could get the environment to shrink if I put the SETLOCAL, massive allocation, and ENDLOCAL within a CALLed subroutine, or within a new cmd.exe process. The new process wasn't much of a surprise, but the CALL solution was.
I haven't had time to fully investigate, but this looks promising.
Dave Benham