1. Vote on the best bounty the oceans have to offer! The poll for the 34th Modeling Contest has begun.
    Dismiss Notice
  2. Awaken what lies in the heart of your swarm. The 17th Techtree Contest has arrived!
    Dismiss Notice
  3. Check out the Staff Job Openings thread.
    Dismiss Notice
Dismiss Notice
Hive 3 Remoosed BETA - NOW LIVE. Go check it out at BETA Hive Workshop! Post your feedback in this new forum BETA Feedback.
Dismiss Notice
60,000 passwords have been reset on July 8, 2019. If you cannot login, read this.

Experimental WC3 loading performance booster

Discussion in 'Warcraft Editing Tools' started by Dr Super Good, Apr 22, 2012.

  1. Dr Super Good

    Dr Super Good

    Spell Reviewer

    Joined:
    Jan 18, 2005
    Messages:
    25,418
    Resources:
    3
    Maps:
    1
    Spells:
    2
    Resources:
    3
    I have created a small experimental Java program that tries to boost the load performance for WarCraft III.

    It works by forcing your system to page in various WarCraft III data files into main memory. This causes there to be no hard page faults (reading from hard disk) when WarCraft III goes to load an asset. The speed benefit is only when loading an asset so it will not make WarCraft III run better. Also remember that WarCraft III will produce its own file cache meaning it will not grant better loading times for maps already played. What it does do is shorten initial loading times giving you performance similar to consecutive loading times.

    WC3BOOST
    Requires: Windows XP or better running Java 7
    Program will not help people which do not have over 1 GB of free memory when playing WarCraft III. Automatically finds WarCraft III install path using system memory.

    Why no Mac support?
    I do not know how to find the data files for WarCraft III on Mac operating systems.

    Simply run the program and then proceed to play WarCraft III or use World Editor. If you have console enabled it is best to leave the program running in the background to reduce the likely hood that the data file pages will get freed.

    Results from a clean start (system just turned on).
    WarCraft III The Frozen Throne boots a few seconds faster (still slower than consecutive boots but that is due to the game loading system libraries).
    World Editor loads a map with a lot of art assets a few seconds quicker.
    WarCraft III will load your favourite map a few seconds quicker (like you played it before).
    When an art asset is created without being preloaded via script, fewer frames will get dropped.

    Such tools as this could be very helpful when playing games like Diablo II where initial loading causes a lot of dropped frames and can endanger your character when teleporting due to your reduced ability to respond.
     

    Attached Files:

    Last edited: Jun 3, 2012
  2. stimmedmarine

    stimmedmarine

    Joined:
    Aug 8, 2011
    Messages:
    284
    Resources:
    0
    Resources:
    0
    when i press the java program "on my desktop" it comes with an "Dun" sound ? and northing pops up...
     
  3. Dr Super Good

    Dr Super Good

    Spell Reviewer

    Joined:
    Jan 18, 2005
    Messages:
    25,418
    Resources:
    3
    Maps:
    1
    Spells:
    2
    Resources:
    3
    If you are using a windows operating system and WarCraft III is installed correctly (the registry contains correct keys) then it will work.

    Nothing is needed to popup and it should have loaded all WarCraft III data files into memory.

    I will work on a UI at a later stage, until then use a console if you want to read what happens.
     
  4. stimmedmarine

    stimmedmarine

    Joined:
    Aug 8, 2011
    Messages:
    284
    Resources:
    0
    Resources:
    0
    what shall happen if it works ? it does not work when it says the "Dun" sound ?
     
  5. Dr Super Good

    Dr Super Good

    Spell Reviewer

    Joined:
    Jan 18, 2005
    Messages:
    25,418
    Resources:
    3
    Maps:
    1
    Spells:
    2
    Resources:
    3
    WarCraft III will load a lot faster (only really noticeable first time you start it since a system reboot). Most importantly maps will load a lot faster because all art assets are already in memory and just need to be loaded into the game.

    The two areas where speed improvements are most noticeable are.
    1. Loading a map in WorldEditor.
    2. Starting a map session the loading phase will complete faster.

    Data read by WarCraft III is naturally cached so you should not notice any improvement beyond getting the performance for loading a map a second time on the first time.
     
  6. Ezekiel12

    Ezekiel12

    Joined:
    Mar 13, 2012
    Messages:
    1,059
    Resources:
    0
    Resources:
    0
    Gives me the error
    'Could not find the main class: loadenhancer.main.LoadEnhancer.
    Program will exit.'

    If it only gives some seconds of reduced time in loading World Editor test maps I wonder how many hours of my life could have been saved with that : )
     
  7. jim7777

    jim7777

    Joined:
    May 27, 2009
    Messages:
    481
    Resources:
    7
    Maps:
    2
    Spells:
    5
    Resources:
    7
    hmm

    what does this thing do?
    A force passing of data to the main memory instead of the paging file?
    Sounds cool... but i think it may cause some little system instability with multi tasking... esp it runs under java o.o

    Does it needs to run on every system startup?
    Does it modify registry keys?
    Is the memory flushed the same way windows flushes memory on shutdown or with the event of Windows that flushes memory?
    How long the data will last? Until memory flush(shutdown) or forever?

    or it just pushes the data into the memory?

    o.o
     
  8. Dr Super Good

    Dr Super Good

    Spell Reviewer

    Joined:
    Jan 18, 2005
    Messages:
    25,418
    Resources:
    3
    Maps:
    1
    Spells:
    2
    Resources:
    3
    It forces all the pages of the WarCraft III data files into main memory. Even if they are not referenced they will sit there until some other page eventually wipes them (which is unliklely to occur any time soon).

    Once the program has finished all the WarCraft III data files are left in memory as soft pages. They will get used if the files are required but will get cleaned if the system runs low on memory so there is no negative performance impact. The only possible negative performance would be if you have too little memory or are relying on the memory to cache some other data files in which case it will cause a lot of pages to be written out that can cause page faults in the future.

    Once before each extensive use of WarCraft III. Even if you used it before and have not restarted your PC it is possible that the WarCraft III data file pages will get cleaned from memory and replaced with other files after enough time and use.

    It is meant to only read it. This is how I get the installation directory of WarCraft III to load the data files from. It uses the protected Windows class used by the Java API for interacting with the Windows registry so any problems with it modifying your registry is caused by your installation of Java and is likely a problem you should raise with the company that maintains Java.

    While the program is running the memory pages will not be low priority and will probably not get freed until low on system memory. When the program closes all files are treated like every other memory mapped file used by every normal I/O operation on Windows systems and will eventually have pages freed when low on system memory (although it will remain higher priority that less recently used files loaded into memory).

    Until the page manager decides it needs the pages in memory for other purposes such as processes or different files. You can forcefully flush all such pages using developer tools but this does cause a massive number of hard page faults (degraded system performance until the working sets are rebuilt).

    This program is hardly that cleaver. It just is more to make people aware of how operating systems cache file data as pages in memory which is why WarCraft III loads instantly the second time you start it but takes many seconds the first time.
     
  9. Starquizer

    Starquizer

    Joined:
    Mar 3, 2006
    Messages:
    1,526
    Resources:
    6
    Maps:
    1
    Spells:
    2
    Tutorials:
    3
    Resources:
    6
    It gave me the same error. I am using DELL laptop with windows 7 does it has something to do with those things ?
     
  10. Dr Super Good

    Dr Super Good

    Spell Reviewer

    Joined:
    Jan 18, 2005
    Messages:
    25,418
    Resources:
    3
    Maps:
    1
    Spells:
    2
    Resources:
    3
    No idea why it is giving you an error while other people are not. You are definatly using Java 7 right?
     
  11. Ezekiel12

    Ezekiel12

    Joined:
    Mar 13, 2012
    Messages:
    1,059
    Resources:
    0
    Resources:
    0
    Oh.. Problem solved then I guess^^..
     
  12. Dr. Brewery Ale

    Dr. Brewery Ale

    Joined:
    Apr 30, 2012
    Messages:
    47
    Resources:
    0
    Resources:
    0
    Good work bro.Keep it up. It works 100%. I prefer C++ so it would be easier. Java always crashes like fatal errors.
     
  13. Dr Super Good

    Dr Super Good

    Spell Reviewer

    Joined:
    Jan 18, 2005
    Messages:
    25,418
    Resources:
    3
    Maps:
    1
    Spells:
    2
    Resources:
    3
    It is far from easier to make with C++. Most of the time I would have to spend making simple list structures to support the nescescary opperations. I do agree that it would be more efficient though as you can then use the memory mapped file objects directly and force it to load in each page (functionality that is abstracted away in Java).

    I have never had that happen. The JRE you are using must be incorrectly set up or faulty.
     
  14. Starquizer

    Starquizer

    Joined:
    Mar 3, 2006
    Messages:
    1,526
    Resources:
    6
    Maps:
    1
    Spells:
    2
    Tutorials:
    3
    Resources:
    6
    Ok, perhaps I did a mistake.

    Correct me if I am wrong, I download the file you attached to any place on my computer then I double click that Java file from where I download it then run WC3 normally, is that right ?
     
  15. Dr Super Good

    Dr Super Good

    Spell Reviewer

    Joined:
    Jan 18, 2005
    Messages:
    25,418
    Resources:
    3
    Maps:
    1
    Spells:
    2
    Resources:
    3
    Yes, all it does is force WarCraft III game files into memory. If you have a modern computer with 4-8 GB of memory this can dramatically reduce loading times as it will not have to read anything from disk while playing. If you have 256 or 512 MB of memory then this will not do anything next to take ages to run and cause a large number of hard page faults. The program will not do anything unusual to your memory as the data file pages will get unloaded as the system requires memory.

    It does not load system libraries. Starting WarCraft III or WorldEdit for the first time will be slower than the second time even after running this program because it has to load the system libraries into memory. This is an area that has to be looked at but is also potentially problematic for portability.
     
  16. Starquizer

    Starquizer

    Joined:
    Mar 3, 2006
    Messages:
    1,526
    Resources:
    6
    Maps:
    1
    Spells:
    2
    Tutorials:
    3
    Resources:
    6
    I am using DELL Inspiron laptop
    Model: N5110
    4 GB RAM
    Java 6
    intel Core i5
    Windows 7
    NVIDIA GeForce GT 525M

    Does anything of the above don't match the requirements ?

    I am getting this error:

    [​IMG]
     
  17. Dr Super Good

    Dr Super Good

    Spell Reviewer

    Joined:
    Jan 18, 2005
    Messages:
    25,418
    Resources:
    3
    Maps:
    1
    Spells:
    2
    Resources:
    3
    You are using Java 1.7?
     
  18. Starquizer

    Starquizer

    Joined:
    Mar 3, 2006
    Messages:
    1,526
    Resources:
    6
    Maps:
    1
    Spells:
    2
    Tutorials:
    3
    Resources:
    6
    No it it version 6, but just to be sure how do I check the version ?
     
  19. Dr Super Good

    Dr Super Good

    Spell Reviewer

    Joined:
    Jan 18, 2005
    Messages:
    25,418
    Resources:
    3
    Maps:
    1
    Spells:
    2
    Resources:
    3
    Under Program and Features in the Control pannel. The version of Java installed is listed there. It needs Java 1.7 (Java 7) to run.
     
  20. Starquizer

    Starquizer

    Joined:
    Mar 3, 2006
    Messages:
    1,526
    Resources:
    6
    Maps:
    1
    Spells:
    2
    Tutorials:
    3
    Resources:
    6
    Ok, I guess its 6

    [​IMG]