Jump to content

[SOLVED] too slow ( load xml , clear xml )


photo

Recommended Posts

large xml data

 

1. load tree -> delay time : 51.290901 ms

 

Xml a;

a.load( "t.xml" );

 

2. parser and make node -> delay time : 140.259293 ms

 

3. Clear XML -> delay time : 20.141502 ms

 

Improvement?

Link to comment

It's NO good idea to load files in render loop as I) file access time is unpredictable and II) XML parsing is a heavy-weight operation ! Try to do the load and parse XML data during init and cache the required data parts for fast access during rendering

Link to comment

XML FileSize is 837K ( a lot of Nodes ).

 

my terrain is seamless zone.

 

i can not load during init.

 

i think that i can process 1 and 3 by thread.

 

but

 

i can not process 2.

Link to comment

Your current approach with such large XML node processing within render loop seems to be wrong by design. What do you what to achive functionally during 2 ? If you could describe your functional requirements (not your technical approach) a little bit more detailed, it might be possible to discuss some alternative approaches (e.g. using binary file for much faster parsing, using step-wise processing of 2 by spreading work over several frames based on some per-frame time limits, etc)

Link to comment
  • 2 weeks later...
You can use NodeSector to handle node loading in the background.
Just for loading textures, meshes or mask images of loaded xml world sub-tree structure, but I don`t think it can be used for background loadind of general xml data structures
Link to comment
  • 3 weeks later...

Just guessing, but mesh/texture resource loading will be handled by filesystem thread asynchronously in the background, but the general approach of file loading and parsing 900K XML (!) data in the render loop is not the best idea...at least you shouldn't be surprised by some heavy render stall :)

Link to comment
  • 2 weeks later...
×
×
  • Create New...