Please sign in to comment.
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Some performance optimizations (#5424)
* Some performance optimizations This is globally removing some memory useless copy * use a const ref return on std::string Settings::get to prevent data copy on getters which doesn't need to copy it * pass some stack created strings to static const as they are not modified anywhere * Camera: return nametags per const ref instead of a list pointer, we only need to read it * INodeDefManager: getAll should be a result ref writer instead of a return copy * INodeDefManager: getAlias should return a const std::string ref * Minimap: unroll a Scolor creation in blitMinimapPixersToImageRadar to prvent many variable construct/destruct which are unneeded (we rewrite the content in the loop) * CNodeDefManager::updateAliases: prevent a idef getall copy * Profiler: constness * rollback_interface: create real_name later, and use const ref * MapBlockMesh updateFastFaceRow: unroll TileSpec next_tile, which has a cost of 1.8% CPU due to variable allocation/destruction, * MapBlockMesh updateFastFaceRow: copy next_tile to tile only if it's a different tilespec * MapBlockMesh updateFastFaceRow: use memcpy to copy next_lights to lights to do it in a single cpu operation
- Loading branch information
Showing with 79 additions and 134 deletions.
- +1 −2 src/camera.h
- +1 −1 src/client/clientlauncher.cpp
- +6 −6 src/client/tile.cpp
- +1 −1 src/drawscene.cpp
- +1 −1 src/game.cpp
- +3 −4 src/itemdef.cpp
- +4 −4 src/itemdef.h
- +11 −37 src/mapblock_mesh.cpp
- +16 −14 src/minimap.cpp
- +5 −4 src/nodedef.cpp
- +14 −19 src/profiler.h
- +2 −2 src/remoteplayer.cpp
- +3 −2 src/rollback_interface.cpp
- +1 −28 src/settings.cpp
- +1 −3 src/settings.h
- +9 −6 src/sky.h
There are no files selected for viewing
Oops, something went wrong.