cmake -E env much slower than plain env

I was made aware of the following commit by the ccache maintainer. Apparently the raw env command is way faster than cmake -E env, which I guess is understandable. If you use cmake -E env a lot in a project, I guess maybe this could add up. I don’t know if we use it heavily internally within CMake for user projects, at least not enough to be noticeable outside use cases like those for launchers like ccache.

Can we get a profile of what takes so long? Is CMake still looking for CMAKE_ROOT and the like even when in -E mode?

You should be able to get them yourself easily I guess:

$ time env FOO=BAR true

real 0m0,001s
user 0m0,001s
sys 0m0,000s

$ time cmake -E env FOO=BAR true

real 0m0,006s
user 0m0,006s
sys 0m0,000s