protonscr

Skip redundant copying steps

protonclosed Feature Request
ValveSoftware/Proton#3009 · opened 2019-08-24 by pchome · updated 2019-09-16 · 6 comments · github
1 matching comments, n / p to jump
Ppchome 2019-08-24 github

Feature Request

I confirm:

  • [x] that I haven't found another request for this feature.
  • [x] that I have checked whether there are updates for my system available that
    contain this feature already.

Description

Currently each run, getcompatpath and waitforexitandrun step doing the same "preparations", including e.g. Wine/DXVK files copying.

I can observe five steps (two iscriptevaluator.exe, two getcompatpath and final waitforexitandrun) for a game launched directly after Steam Client start, and then three steps (two iscriptevaluator.exe runs and final waitforexitandrun) for each sequential launch of the same game. This may likely vary for different games.

So, if iscriptevaluator.exe and getcompatpath don'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.

Aaeikum 2019-08-26 github

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.

?ghost 2019-08-26 github

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.

Ppchome 2019-09-07 github

@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.

Aaeikum 2019-09-09 github

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.

Ppchome 2019-09-14 github

"As simple as possible" is always better. Closing, as premature optimization request.

Aaeikum 2019-09-16 github

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 versions