Notable lag in My maps section

Started by Lord_Farin, September 07, 2011, 04:19:42 PM

Previous topic - Next topic

Lord_Farin

When I let my mouse hover over the maps visible in the My maps section, it will now take non-trivial time to display the map information. The only map on which this has happened to me thus far is #53: 'MD3: The Plan' by Fisherck.

Most likely this has to do with the loading of the map ID (from file, I suppose). An idea would be to gather this information in a separate thread, and then displaying it when obtained (also, it could do with a memorisation; now it reloads the information every single time I scroll over it).

I really appreciate the new 'advance one frame' feature, although I most likely will be too lazy to be that precise. But it can make for a huge difference (that one second could just be the border between life and death).

Just my €0.02 on the new update. Thanks for the effort, V!
Behold, Nexus! Looketh skywards, for thy obliteration thence nighs, my foul enemy!

Karsten75

If you have many maps in your "My Maps" this may be the problem. I have only a few and could not recreate this.

knucracker

Maps that have a custom background, custom tiles, and custom character images can take a little longer to load when mouseing over.  The preview has to be generated by loading those images from the map.  The more custom images there are in the map, the longer it takes.

On my machine we are talking about maybe 100ms-200ms difference, though.  I see a slight delay on this map compared to instantaneous (to my eyes) for simpler maps.

Lord_Farin

Quote from: virgilw on September 08, 2011, 09:48:14 AM
Maps that have a custom background, custom tiles, and custom character images can take a little longer to load when mouseing over.  The preview has to be generated by loading those images from the map.  The more custom images there are in the map, the longer it takes.

On my machine we are talking about maybe 100ms-200ms difference, though.  I see a slight delay on this map compared to instantaneous (to my eyes) for simpler maps.
I agree. Also on my system this is about the time span concerned. It is notable, however, and also occurs when just 'passing by' with the mouse. This causes a delay in order to gather information I don't want, which can be annoying. Also, I am certain that this problem did not occur on the 307 build, so something must have changed...
Behold, Nexus! Looketh skywards, for thy obliteration thence nighs, my foul enemy!

knucracker

I see the same delay on some maps in both 307 and 327.  This makes sense to me since I didn't touch anything around the custom maps loading and thumbnail generated (I also just spent about 20 minutes profiling and looking at the code).

The delay comes mostly from loading (de-mangling) the map file so I can pull the description and generate a preview image from it.  It is particularly 'bad' on a map like "MD 3: The Plan".  Believe it or not, but the reason it is worse on this map is because that map clocks in at over 800k in size.  And the reason that map is that large is because it uses custom characters that are as large as the custom background.  The custom background and custom characters help push the file size up to 800+k. 

Lord_Farin

At the very least, thanks for your time and replies. I really highly value developers whom actually listen (and respond) to the feedback given by end users. Having said that, can I make a stand for the information you load every time the map is scrolled over being saved somewhere in the RAM? This would reduce the load time to just once every time the custom map section is opened (or even per game instantiation). I will understand if you decide this would be too much of a memory footprint though.
Behold, Nexus! Looketh skywards, for thy obliteration thence nighs, my foul enemy!

knucracker

I could probably do that... it's just a little tricky to know when the cached data is stale.  Folks may put or change files in their customgames directory while CW2 is running, so I'd have to know when my cached image and description had changed.  I'd have to know this without opening the game file (which is where the time is spent).  I could do this by just noting the file name and time stamp...  It's just a little tricky to add this into that page (but not impossible).

As a quick thing, I just went through and did a standard optimization on the code path.  Most of the time was spent in cryptographic functions that looped over the bytes of the file.  Some AS3 optimizations have let me make the demangling operation about 30% faster.  There is a still a little delay, but it is less now. 

As time permits I'll look at the caching solution.

Lord_Farin

Again, thanks for the spent effort  :)
Behold, Nexus! Looketh skywards, for thy obliteration thence nighs, my foul enemy!

Karsten75


weekendgamer

The lag is >1 second in my machine.
It is not a particularly fast machine, but it can run most applications with ease, the lag on my computer is only that long in the my maps page.
Sorry for the late replies.