diff options
| author | Ansariel Hiller <Ansariel@users.noreply.github.com> | 2025-04-25 19:52:38 +0200 | 
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-04-25 20:52:38 +0300 | 
| commit | 10a324a1034c177b95545ac7ffaa6aa6abed65ff (patch) | |
| tree | bfa78ec1ac88c92199339ed8b24ee3b5f50ecb4b /indra/llprimitive | |
| parent | 3e5f4fd0c4cb31d94c9255b46d3ff9e2f06d327b (diff) | |
Reduce cost of joint lookups by reducing string allocations via use of std::string_view and heterogeneous map lookups (#3970)
Diffstat (limited to 'indra/llprimitive')
| -rw-r--r-- | indra/llprimitive/lldaeloader.cpp | 2 | ||||
| -rw-r--r-- | indra/llprimitive/lldaeloader.h | 26 | ||||
| -rw-r--r-- | indra/llprimitive/llgltfloader.cpp | 26 | ||||
| -rw-r--r-- | indra/llprimitive/llgltfloader.h | 24 | ||||
| -rw-r--r-- | indra/llprimitive/llmodelloader.h | 2 | 
5 files changed, 40 insertions, 40 deletions
| diff --git a/indra/llprimitive/lldaeloader.cpp b/indra/llprimitive/lldaeloader.cpp index 0759447902..eadb052b38 100644 --- a/indra/llprimitive/lldaeloader.cpp +++ b/indra/llprimitive/lldaeloader.cpp @@ -880,7 +880,7 @@ LLDAELoader::LLDAELoader(      void*               opaque_userdata,      JointTransformMap&  jointTransformMap,      JointNameSet&       jointsFromNodes, -    std::map<std::string, std::string>&     jointAliasMap, +    std::map<std::string, std::string, std::less<>>&     jointAliasMap,      U32                 maxJointsPerMesh,      U32                 modelLimit,      bool                preprocess) diff --git a/indra/llprimitive/lldaeloader.h b/indra/llprimitive/lldaeloader.h index 4531e03474..dc20feca52 100644 --- a/indra/llprimitive/lldaeloader.h +++ b/indra/llprimitive/lldaeloader.h @@ -47,19 +47,19 @@ public:      dae_model_map   mModelsMap;      LLDAELoader( -        std::string                         filename, -        S32                                 lod, -        LLModelLoader::load_callback_t      load_cb, -        LLModelLoader::joint_lookup_func_t  joint_lookup_func, -        LLModelLoader::texture_load_func_t  texture_load_func, -        LLModelLoader::state_callback_t     state_cb, -        void*                               opaque_userdata, -        JointTransformMap&                  jointTransformMap, -        JointNameSet&                       jointsFromNodes, -        std::map<std::string, std::string>& jointAliasMap, -        U32                                 maxJointsPerMesh, -        U32                                 modelLimit, -        bool                                preprocess); +        std::string                                      filename, +        S32                                              lod, +        LLModelLoader::load_callback_t                   load_cb, +        LLModelLoader::joint_lookup_func_t               joint_lookup_func, +        LLModelLoader::texture_load_func_t               texture_load_func, +        LLModelLoader::state_callback_t                  state_cb, +        void*                                            opaque_userdata, +        JointTransformMap&                               jointTransformMap, +        JointNameSet&                                    jointsFromNodes, +        std::map<std::string, std::string, std::less<>>& jointAliasMap, +        U32                                              maxJointsPerMesh, +        U32                                              modelLimit, +        bool                                             preprocess);      virtual ~LLDAELoader() ;      virtual bool OpenFile(const std::string& filename); diff --git a/indra/llprimitive/llgltfloader.cpp b/indra/llprimitive/llgltfloader.cpp index 480012699a..724b1a88b2 100644 --- a/indra/llprimitive/llgltfloader.cpp +++ b/indra/llprimitive/llgltfloader.cpp @@ -66,19 +66,19 @@ static const std::string lod_suffix[LLModel::NUM_LODS] =  }; -LLGLTFLoader::LLGLTFLoader(std::string filename, -    S32                                 lod, -    LLModelLoader::load_callback_t      load_cb, -    LLModelLoader::joint_lookup_func_t  joint_lookup_func, -    LLModelLoader::texture_load_func_t  texture_load_func, -    LLModelLoader::state_callback_t     state_cb, -    void *                              opaque_userdata, -    JointTransformMap &                 jointTransformMap, -    JointNameSet &                      jointsFromNodes, -    std::map<std::string, std::string> &jointAliasMap, -    U32                                 maxJointsPerMesh, -    U32                                 modelLimit) //, -    //bool                                preprocess) +LLGLTFLoader::LLGLTFLoader(std::string                filename, +    S32                                               lod, +    LLModelLoader::load_callback_t                    load_cb, +    LLModelLoader::joint_lookup_func_t                joint_lookup_func, +    LLModelLoader::texture_load_func_t                texture_load_func, +    LLModelLoader::state_callback_t                   state_cb, +    void *                                            opaque_userdata, +    JointTransformMap &                               jointTransformMap, +    JointNameSet &                                    jointsFromNodes, +    std::map<std::string, std::string, std::less<>> & jointAliasMap, +    U32                                               maxJointsPerMesh, +    U32                                               modelLimit) //, +    //bool                                            preprocess)      : LLModelLoader( filename,                       lod,                       load_cb, diff --git a/indra/llprimitive/llgltfloader.h b/indra/llprimitive/llgltfloader.h index 66671d1c5a..848a07c1e4 100644 --- a/indra/llprimitive/llgltfloader.h +++ b/indra/llprimitive/llgltfloader.h @@ -121,18 +121,18 @@ class LLGLTFLoader : public LLModelLoader      typedef std::map<std::string, LLImportMaterial> material_map;      LLGLTFLoader(std::string filename, -                    S32                                 lod, -                    LLModelLoader::load_callback_t      load_cb, -                    LLModelLoader::joint_lookup_func_t  joint_lookup_func, -                    LLModelLoader::texture_load_func_t  texture_load_func, -                    LLModelLoader::state_callback_t     state_cb, -                    void *                              opaque_userdata, -                    JointTransformMap &                 jointTransformMap, -                    JointNameSet &                      jointsFromNodes, -                    std::map<std::string, std::string> &jointAliasMap, -                    U32                                 maxJointsPerMesh, -                    U32                                 modelLimit); //, -                    //bool                                preprocess ); +                    S32                                             lod, +                    LLModelLoader::load_callback_t                  load_cb, +                    LLModelLoader::joint_lookup_func_t              joint_lookup_func, +                    LLModelLoader::texture_load_func_t              texture_load_func, +                    LLModelLoader::state_callback_t                 state_cb, +                    void *                                          opaque_userdata, +                    JointTransformMap &                             jointTransformMap, +                    JointNameSet &                                  jointsFromNodes, +                    std::map<std::string, std::string,std::less<>> &jointAliasMap, +                    U32                                             maxJointsPerMesh, +                    U32                                             modelLimit); //, +                    //bool                                          preprocess );      virtual ~LLGLTFLoader();      virtual bool OpenFile(const std::string &filename); diff --git a/indra/llprimitive/llmodelloader.h b/indra/llprimitive/llmodelloader.h index 530e61e2b8..aece922111 100644 --- a/indra/llprimitive/llmodelloader.h +++ b/indra/llprimitive/llmodelloader.h @@ -36,7 +36,7 @@ class LLJoint;  typedef std::map<std::string, LLMatrix4> JointTransformMap;  typedef std::map<std::string, LLMatrix4>::iterator JointTransformMapIt; -typedef std::map<std::string, std::string> JointMap; +typedef std::map<std::string, std::string, std::less<>> JointMap;  typedef std::deque<std::string> JointNameSet;  const S32 SLM_SUPPORTED_VERSION = 3; | 
