Should be easy to benchmark this. Just run with and without those copy steps and time each execution (ignoring whether the subsequent launch is "correct" or not; we're just gathering data about how long that step takes). I'd be surprised if it's a significant amount of time, but benchmarking would tell us.
If it was a warranted amount of time then it may be worth it. Would be a shame if there were unforeseen complications just for a few seconds one time per game launch. Stability would better for some tiny amount of time.
@aeikum
I rather mean "there is a room for improvement".
I did quick "start/stop" test earlier, and it takes near 10sec for additional steps, before the final waitforexitandrun step. They seems running in parallel, so assuming the copying itself is very quick operation, and a work done by each step takes almost nothing, the time was spent on Wine init.
I'm not sure about safety of parallel copying of the same files in the same place, but let's forget about this for now. Even if it's copying of near 100MB each time user hits "Play".
That was for regular launch. Today I noticed that for initial launch (first time installation), with 3 step installation process (DirectX, etc.), total number of run, getcompatpath and waitforexitandrun steps was 42. Maybe will be 2x more for 6 step installation processes, which was more frequent for my game library.
Again, not a big deal, but could be better.
Right, the question is if the changes you're proposing actually make a difference. You can't know that without benchmarking. Like I said, it should be easy. Run the script a hundred times with the extra ops and average the runtimes; then run a hundred times without the extra ops and compare averages. Since we're just timing the Proton script runtime, it doesn't matter if the resulting prefix is functional.
"As simple as possible" is always better. Closing, as premature optimization request.
For the record, I'm not opposed to optimizations like this. We just need to understand the value so we can do a pro/con analysis of any code changes.
proton 4.11x1 2019-08
Feature Request
I confirm:
contain this feature already.
Description
Currently each
run,getcompatpathandwaitforexitandrunstep doing the same "preparations", including e.g. Wine/DXVK files copying.I can observe five steps (two
iscriptevaluator.exe, twogetcompatpathand finalwaitforexitandrun) for a game launched directly after Steam Client start, and then three steps (twoiscriptevaluator.exeruns and finalwaitforexitandrun) for each sequential launch of the same game. This may likely vary for different games.So, if
iscriptevaluator.exeandgetcompatpathdon't rely on some data (DLL's, pfx, etc.) then it would be good to skip that data collection/creation for this steps. May save a few seconds for each game launch, I suppose.Risks [optional]
Moderate - implementation may introduce additional code complexity.