From e2e4c1daaa47df7892ca2dee4d317164726928f9 Mon Sep 17 00:00:00 2001 From: Aras Pranckevicius Date: Sun, 27 Mar 2022 14:25:48 +0300 Subject: 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 --- release/license/THIRD-PARTY-LICENSES.txt | 2 ++ 1 file changed, 2 insertions(+) (limited to 'release/license') diff --git a/release/license/THIRD-PARTY-LICENSES.txt b/release/license/THIRD-PARTY-LICENSES.txt index 933f03b5564..59f53832c9b 100644 --- a/release/license/THIRD-PARTY-LICENSES.txt +++ b/release/license/THIRD-PARTY-LICENSES.txt @@ -2961,6 +2961,8 @@ Copyright (c) 2009, 2010, 2013-2016 by the Brotli Authors. ** Expat; version 2.2.10 -- https://github.com/libexpat/libexpat/ Copyright (c) 1998-2000 Thai Open Source Software Center Ltd and Clark Cooper Copyright (c) 2001-2019 Expat maintainers +** {fmt}; version 8.1.1 -- https://github.com/fmtlib/fmt +Copyright (c) 2012 - present, Victor Zverovich ** JSON for Modern C++; version 3.10.2 -- https://github.com/nlohmann/json/ Copyright (c) 2013-2021 Niels Lohmann ** Libxml2; version 2.9.10 -- http://xmlsoft.org/ -- cgit v1.2.3