Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAras Pranckevicius <aras@nesnausk.org>2022-03-27 14:25:48 +0300
committerAras Pranckevicius <aras@nesnausk.org>2022-03-27 14:25:48 +0300
commite2e4c1daaa47df7892ca2dee4d317164726928f9 (patch)
treec0e01160ae6b39c34dd8887b9ca21389dbf93848 /source/blender/io/wavefront_obj/tests
parent3e12488b4ec212374618514095d514edbea136fc (diff)
OBJ: use fmt library instead of sprintf for faster formatting
On Windows/MSVC this gives a minor (~20%) speedup presumably due to a faster float/int formatter. On macOS (Xcode13), this gives a massive speedup, since snprintf that is in system libraries ends up spending almost all the time inside some locale-related mutex lock. The actual exporter code becomes quite a bit smaller too, since it does not have to do any juggling to support std::string arguments, and the buffer handling code is smaller as well. Windows (VS2022 release build, Ryzen 5950X 32 threads) timings: - Blender 3.0 splash scene (2.4GB obj): 4.57s -> 3.86s - Monkey subdivided level 6 (330MB obj): 1.10s -> 0.99s macOS (Xcode 13 release build, Apple M1Max) timings: - Blender 3.0 splash scene (2.4GB obj): 21.03s -> 5.52s - Monkey subdivided level 6 (330MB obj): 3.28s -> 1.20s Linux (ThreadRipper 3960X 48 threads) timings: - Blender 3.0 splash scene (2.4GB obj): 10.10s -> 4.40s - Monkey subdivided level 6 (330MB obj): 2.16s -> 1.37s The produced obj/mtl files are identical to before. Reviewed By: Howard Trickey, Dalai Felinto Differential Revision: https://developer.blender.org/D13998
Diffstat (limited to 'source/blender/io/wavefront_obj/tests')
-rw-r--r--source/blender/io/wavefront_obj/tests/obj_exporter_tests.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/source/blender/io/wavefront_obj/tests/obj_exporter_tests.cc b/source/blender/io/wavefront_obj/tests/obj_exporter_tests.cc
index b8fecfb25f3..7e3a9228c3b 100644
--- a/source/blender/io/wavefront_obj/tests/obj_exporter_tests.cc
+++ b/source/blender/io/wavefront_obj/tests/obj_exporter_tests.cc
@@ -241,7 +241,7 @@ TEST(obj_exporter_writer, mtllib)
TEST(obj_exporter_writer, format_handler_buffer_chunking)
{
/* Use a tiny buffer chunk size, so that the test below ends up creating several blocks. */
- FormatHandler<eFileType::OBJ, 16, 8> h;
+ FormatHandler<eFileType::OBJ, 16> h;
h.write<eOBJSyntaxElement::object_name>("abc");
h.write<eOBJSyntaxElement::object_name>("abcd");
h.write<eOBJSyntaxElement::object_name>("abcde");