Changes between Version 2 and Version 3 of Ticket #1995


Ignore:
Timestamp:
Jun 24, 2013, 1:48:19 AM (11 years ago)
Author:
Jorma Rebane
Comment:

CModelDef fixes uploaded. This patch addresses two problems: 1) CModelDef loading performance

In order to make loading faster, had to change the format of cached binary model data. The new model cache files take a tiny bit more disk space, but in return they load several times faster and the loaded data takes less memory.

2) Complex dynamic objects in structs

One of the main perf hitters was a per-vertex (yes, per each vertex!) std::vector<float> for multiple UV's. This was replaced with 2x CVector2D UV0 & UV1. Another one was an std::string for model prop points, which was replaced with a fixed size buffer m_Name[20] and with an additional m_NameLength.

The result: much better memory performance and usage for model loading.

In order for this to work, I had to change the version of the PMD (binary model cache) format to 4 and change the way models are saved to PMD. This may invalidate any existing model cache. Backwards compatibility for versions 1, 2, 3 is there.

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #1995 – Description

    v2 v3  
    55{{{
    66<progress>, <memblock>, <total memops>, <stacktrace>
    7 ( ),            size 4,         count 61320,    modeldef.cpp:300
    8 ( ),            size 8,         count 61320,    modeldef.cpp:301
     7(V),            size 4,         count 61320,    modeldef.cpp:300
     8(V),            size 8,         count 61320,    modeldef.cpp:301
    99( ),            size 48,        count 42028,    parser.cpp:246
    1010( ),            size 36,        count 40866,    guimanager.cpp:273 & 265
    11 ( ),            size 8,         count 32749,    modeldef.cpp:241
     11(V),            size 8,         count 32749,    modeldef.cpp:241
    1212( ),            size 32,        count 27638,    textrenderer.cpp:136
    1313( ),            size 8,         count 21952,    cgui.cpp:986