FS#423 - Improved loading causes high CPU use with long trains
Attached to Project:
OpenTTD
Opened by Danny (Danny) - Wednesday, 29 November 2006, 04:41 GMT
Last edited by Remko Bijker (Rubidium) - Friday, 09 March 2007, 08:53 GMT
Opened by Danny (Danny) - Wednesday, 29 November 2006, 04:41 GMT
Last edited by Remko Bijker (Rubidium) - Friday, 09 March 2007, 08:53 GMT
|
Details1. A test with 40 trains, each 100 cars taking passengeres between 2 stations used between 10 & 20 % cpu and caused the game to jolt every couple of secconds.
This is occuring in the attached saved game. Turning 'improved loading algorithm' off reduced cpu to 0% and things ran normally. The config attached was used to create the game, but I have altered some of the YAPF settings in game which may assert with revisions before ~725x. 2. This is not confirmed, but I am suspicious that the rating calculations do not reach 100% when they should when using improved loading. |
This task depends upon
Closed by Remko Bijker (Rubidium)
Friday, 20 April 2007, 08:00 GMT
Reason for closing: Fixed
Additional comments about closing: In r9683.
Friday, 20 April 2007, 08:00 GMT
Reason for closing: Fixed
Additional comments about closing: In r9683.
I'll take a look at it & see if I can sus out the profiler thing.
If I knew enough C I would setup a queue of vehicle references for each cargo type at the station. Trains which needed to wait for cargo would add their cars to the appropriate queue, and wait. When cargo arrived at the station, it would be transfered to the vehicles in the queue. This way no looping or checking needs to be done, and it would be easier to modify the loading order for any new features.
Maybe some other time, or maybe it's already done in the MiniN, but I've had my fill of C for now.
LoadWait 46.083 46.083 847 847
o_O using 46% of the CPU time...good, very good...