Game loading and saved state restoring takes about 4 minutes

User avatar
golcan
Posts: 1787
Joined: 09 Dec 2014 03:21

Re: Game loading and saved state restoring takes about 4 min

#11 Post by golcan » 24 Feb 2017 11:31

Hi mates,

Very interesting topic. :)
midix wrote:The question then is - why does the caching utilize only about 25% of my CPU cores/threads? In comparison, when I run some test benchmark tools with full multicore support, I see all my CPU cores and threads working at 100%.
midix wrote:... So, clearly ETS2 caching is doing something not efficient enough. Maybe it spawns threads from time to time and there are no 4 threads running during all the caching process. Or maybe it suffers from the infamous "false sharing" issue and needs some paddings for its datastructures. I'm just guessing here, multithreading is tricky and sometimes it can go wrong.
Max wrote:... jut note that running four independent tasks with local data only is bit different than run four tasks, that share and access some common data .. ;)

Exactly, how cpu is consumed by threads depends on what threads do and other factors (including OS resource management subsystems).
The fact that a given thread is not consuming cpu all the time doesn't mean that a problem is present in the code, unless one find clear information that proves the problem.
Max wrote:... the 2 minute task you found is preparation of trade routes based on map topology.
Please Max, if possible, what type of graphs and what variants of Dijkstra's algorithm are you using for trade routes calculations?
AFAIK, early versions of Dijkstra's algorithm spend a lot of time sorting nodes. Time is exponential when lists are used, but tends to be more linear for other modified versions (for example, when binary heap or Fibonacci heap are used).
Regarding the Thorup's Linear Time Algorithm, do you think that some variant of it could be used as replacement for Dijkstra's-based algorithms in the future? (More info here, including interesting performance comparisons - slides 122 onward).
Thank you very much in advance.

Kind regards.
midix
Posts: 6
Joined: 22 Feb 2017 20:10

Re: Game loading and saved state restoring takes about 4 min

#12 Post by midix » 24 Feb 2017 13:47

Thanks, just tried 1.3 - wow, it was blazing fast, only about 15 seconds from desktop to driving.
Of course, there's not much sense to compare caching algorithms without mods and large DLCs.

So, now I have a tough choice - keep v1.3 and enjoy fast loading without any mod goodness until my PC upgrade (or maybe SCS will invent some new trick in next updates) or return to 1.26 and train my patience and learn how to drive more carefully to avoid 4 minutes restoring times from saved state.
User avatar
Max
SCS Software
Posts: 6479
Joined: 26 Nov 2012 10:00
Location: SCS, Prague

Re: Game loading and saved state restoring takes about 4 min

#13 Post by Max » 24 Feb 2017 15:33

we made some minor experiments here.
we cannot use hyperthreading (it is useful if you have two threads that wait to another one occasionally, ours are performing heavy computing non-stop), but we maybe could bit better utilize cores as main caching thread spend some time waiting on one core to collect data from all searching threads. instead of waiting it could do work for one of them and as a whole thus be a bit faster. its not much difference on many cores (few percents), but if you have just two cores it can help you in measurable way (we made some simulations).

it wont be early as current update is in finishing state and some other changes on the way, but eventually ...
Nobody can tell you anything about it. Those who know about it aren't allowed to talk. And those who talk know nothing.
User avatar
Komat
SCS Software
Posts: 976
Joined: 26 Nov 2012 09:22

Re: Game loading and saved state restoring takes about 4 min

#14 Post by Komat » 24 Feb 2017 18:09

golcan wrote:what variants of Dijkstra's algorithm are you using for trade routes calculations?
We are using binary heap for sorting.
Regarding the Thorup's Linear Time Algorithm, do you think that some variant of it could be used as replacement for Dijkstra's-based algorithms in the future?
That algorithm assumes undirected graph while we are using a directed one.
User avatar
Reinhard
Posts: 4711
Joined: 20 Dec 2012 16:46
Location: Berlin, Germany

Re: Game loading and saved state restoring takes about 4 min

#15 Post by Reinhard » 24 Feb 2017 18:52

midix wrote: So, now I have a tough choice - keep v1.3 and enjoy fast loading without any mod goodness until my PC upgrade (or maybe SCS will invent some new trick in next updates) or return to 1.26 and train my patience and learn how to drive more carefully to avoid 4 minutes restoring times from saved state.
I think the choice is easy. There were so many improvements since 1.3. Twenty-three major patches are a lot. You would have a tough time to find mods for this old version. Especially map mods. There was nothing comparable then. Too early.

If you are willing to sacrifice the map-mods anyway, the alternative, an up-to-date game without map mods, is far more attractive.

So the real question is: patience or massive map-mods.

Dijkstra? Gosh am I grateful that I can call the legacy of such dead guys "an other's people problem", now. No more headaches for me. :D
User avatar
golcan
Posts: 1787
Joined: 09 Dec 2014 03:21

Re: Game loading and saved state restoring takes about 4 min

#16 Post by golcan » 24 Feb 2017 20:23

Hi Komat,

Thank you very much for your quick answer. :)
A version of Thorup's algorithm for planar digraphs is also available, but I guess you are not using a planar digraph for trade routes calculation.

Kind regards.
User avatar
Cadde
Posts: 6800
Joined: 24 Apr 2013 18:08
Location: Have no fear, i am from the internets!

Re: Game loading and saved state restoring takes about 4 min

#17 Post by Cadde » 03 Mar 2017 18:52

Please correct me if i am wrong, i might not have caught on.

But can't you run that cache once and save it in binary format so it just loads the result of the last run?
And as the map checksum (with mods) changes, you recalculate it and save that?

Wouldn't loading times improve immensely the next time the game is started then?
On extended hiatus.
User avatar
Komat
SCS Software
Posts: 976
Joined: 26 Nov 2012 09:22

Re: Game loading and saved state restoring takes about 4 min

#18 Post by Komat » 03 Mar 2017 21:40

Cadde wrote:But can't you run that cache once and save it in binary format so it just loads the result of the last run?
And as the map checksum (with mods) changes, you recalculate it and save that?
We are planing to eventually add that. I just was not a high priority as the operation was reasonably fast with the official content in relation to how frequently it should happen (my work PC with 5 year old CPU generates navigation for entire ETS2 map under 6 seconds).
Post Reply

Return to “General discussion about the game”

Who is online

Users browsing this forum: Crady, dvo, marvix, SmalandAB, TOFTG and 13 guests