wesnoth-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Wesnoth-dev] C++ streams and VC++6


From: David White
Subject: Re: [Wesnoth-dev] C++ streams and VC++6
Date: Wed, 27 Apr 2005 07:20:43 -0500
User-agent: Mozilla Thunderbird 0.8 (Windows/20040913)

Guillaume Melquiond wrote:

On 4/27/05, David White wrote:
In 0.9.0, we switched to using istreams to read files, instead of using
the C API.

Unfortunately it seems the istreams implementation that ships with VC++6
is very slow. It can take a very long time for an uncached game to load
a campaign -- up to a minute on my 2Ghz machine, and some users seem to
report it taking many minutes.

On my 600MHz machine and GCC 3.3, it takes six seconds to create the
cache for HttT (it would be even faster if I was not using a
zip-install Wesnoth). This it is the delay for the "loading scenario"
to appear after "no valid cache found" was displayed. Once the cache
is built, this step takes less than one second.

And then, it takes ages to display HttT map (the time necessary to
initialize the scenario): 12 seconds. This is huge, it also appeared
at the time of 0.9.0, and the main problem lies within: (--log-info=all)

       BEGIN: terrain_builder::parse_config
       END: terrain_builder::parse_config (took 10387ms)

and there is no stream at all in the related functions!

So before discussing the stream matter any further, I would like to be
sure that the many minutes the users experience with the VC6 build are
really during preprocessing / tokenizing / parsing.
On my 2Ghz Windows machine when there is no cache present, we get,

BEGIN: read_game_cfg
no valid cache found. Writing cache to 'f:/wesnoth/userdata/cache/game.cfg-cache-v0.9.1-CAMPAIGN_HEIR_TO_THE_THRONE-MEDIUM-NORMAL'
 BEGIN: preprocessing file...
info general: Streaming data/game.cfg for reading.
info general: Streaming data/themes/default.cfg for reading.
....many more file streaming lines omitted
 END: preprocessing file... (took 40184ms)
info general: Streaming f:/wesnoth/userdata/cache/game.cfg-cache-v0.9.1-CAMPAIGN_HEIR_TO_THE_THRONE-MEDIUM-NORMAL for writing. info general: Streaming f:/wesnoth/userdata/cache/game.cfg-cache-v0.9.1-CAMPAIGN_HEIR_TO_THE_THRONE-MEDIUM-NORMAL.checksum for writing.
END: read_game_cfg (took 41047ms)
loading scenario: 'The_Elves_Besieged'
...
BEGIN: terrain_builder::parse_config
END: terrain_builder::parse_config (took 1112ms)
BEGIN: terrain_builder::parse_config
END: terrain_builder::parse_config (took 0ms)
BEGIN: terrain_builder::build_terrains
END: terrain_builder::build_terrains (took 60ms)

So, as we can see, the 'insane' amount of time takes place in preprocessing, and I assume, when reading files. When I have time I will try replacing the streams with C-style I/O, and see how much faster it is.

terrain_builder::parse_config may be a good place to look at later to tweak load times, but isn't the cause of the incredibly long load times on Windows.

David




reply via email to

[Prev in Thread] Current Thread [Next in Thread]