Replace tinyxml2 with pugixml
Parsing a 60 MB save drops from about 350 ms to 30 ms (a whole load from about
620 ms to 200). The reader keeps tinyxml2's rules for numbers and booleans
("%d"/"%f" on the leading text; a number or true/false), so every golden is
unchanged, and parse errors now give a line. SVG composing (pack and merge)
builds, clones and prints through pugixml. Tests check escaping by reading a
save back instead of comparing against tinyxml2's printer, and cut
SourceDocument from saves as text. pugixml is a submodule at v1.16; the About
window lists it, and simdjson, instead of tinyxml2.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
b69b0eaa1b
commit
201a7c7cfc
9 files changed
+242
-195
No files matched your search
+3
-5
@@ -81,7 +81,7 @@ set(IMGUI_SRC
|
||||
external/imgui/backends/imgui_impl_sdl3.cpp
|
||||
external/imgui/backends/imgui_impl_opengl3.cpp)
|
||||
|
||||
set(TINYXML2_SRC external/tinyxml2/tinyxml2.cpp)
|
||||
set(PUGIXML_SRC external/pugixml/src/pugixml.cpp)
|
||||
set(SIMDJSON_SRC external/simdjson/singleheader/simdjson.cpp)
|
||||
|
||||
file(GLOB PROJECT_SRC CONFIGURE_DEPENDS
|
||||
@@ -119,7 +119,6 @@ set(CORE_INCLUDE_DIRS
|
||||
external
|
||||
external/imgui
|
||||
external/glm
|
||||
external/tinyxml2
|
||||
external/lunasvg/include
|
||||
external/SDL/include
|
||||
src
|
||||
@@ -127,7 +126,7 @@ set(CORE_INCLUDE_DIRS
|
||||
src/resource
|
||||
src/util)
|
||||
|
||||
add_library(anm2ed_core STATIC ${CORE_SRC} ${TINYXML2_SRC} ${SIMDJSON_SRC} ${IMGUI_CORE_SRC})
|
||||
add_library(anm2ed_core STATIC ${CORE_SRC} ${PUGIXML_SRC} ${SIMDJSON_SRC} ${IMGUI_CORE_SRC})
|
||||
target_include_directories(anm2ed_core PUBLIC ${CORE_INCLUDE_DIRS})
|
||||
target_link_libraries(anm2ed_core PUBLIC lunasvg)
|
||||
target_compile_definitions(anm2ed_core PUBLIC IMGUI_DISABLE_OBSOLETE_FUNCTIONS IMGUI_DEBUG_PARANOID IMGUI_ENABLE_DOCKING)
|
||||
@@ -158,8 +157,7 @@ target_include_directories(
|
||||
external
|
||||
external/imgui
|
||||
external/glm
|
||||
external/tinyxml2
|
||||
external/lunasvg
|
||||
external/lunasvg
|
||||
external/SDL
|
||||
external/SDL_mixer
|
||||
external/SDL_mixer/include
|
||||
|
||||
Reference in new issue
Block a user