Please login or register.

Login with username, password and session length
Advanced search  

News:

Forum rules - please read before posting, it can save you a lot of time.

Pages: 1 [2]  All

Author Topic: Saving and loading takes too looooong  (Read 10110 times)

0 Members and 1 Guest are viewing this topic.

adonf

  • Regular poster
  • ***
  • Karma: 0
  • Offline Offline
  • Posts: 124
    • View Profile
Re: Saving and loading takes too looooong
« Reply #15 on: April 26, 2007, 11:37:00 AM »

So we wrote some code that increases the saving time from a handful of seconds to one minute after it's run:
(scroll down, the interesting part is at the end)

Code: [Select]
var rand;
var ar = new Array();
// initialize string randomly
for (var k = 0; k <= 20; k = k + 1)
{
            rand = Random(1,3);     
            switch(rand)
            {
                        case 1:
                                    ar[k] = "G/500";
                                    break;
                        case 2:
                                    ar[k] = "B/1000";
                                    break;
                        case 3:
                                    ar[k] = "R/100";
                                    break;             
            }
}
 
// Change i to change the save time
// i = 500  --> 1mn
// i = 1000  --> 3mn
for (var i = 1; i <= 500; i = i + 1)
{
            for (var j = 0; j < ar.Length; j = j + 1)
            {
                        var ch = new String(ar[j]);
                        var tab = ch.Split("/");
            }
}
Game.Msg("GO SAVE!!!");
Game.LOG("FINISH!!");

If we comment out the lines with new String and Split the saving time does not change.

We're going to work around these functions but I hope this can help you track these leaks. Oh and we did the same kinda thing with dynamic entities and it didn't change a thing.

Cheers,
Olivier
Logged
I am the Milkman. My milk is good.

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: Saving and loading takes too looooong
« Reply #16 on: April 26, 2007, 12:27:29 PM »

Thanks! I'll look into it.
It should be easy to work around by not using array, but a simple object variable and track the length separately, but I'm sure you know that.
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: Saving and loading takes too looooong
« Reply #17 on: April 28, 2007, 05:00:09 PM »

All right, I plumbed the leak (it was actually in the String.Split() method). The fix is available in the latest WME build.

Thanks again for providing the repro code.
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

adonf

  • Regular poster
  • ***
  • Karma: 0
  • Offline Offline
  • Posts: 124
    • View Profile
Re: Saving and loading takes too looooong
« Reply #18 on: May 02, 2007, 10:03:21 AM »

and thanks to you for fixing it  ;D
Logged
I am the Milkman. My milk is good.
Pages: 1 [2]  All
 

Page created in 0.072 seconds with 23 queries.