tornavis/extern
Aras Pranckevicius 213cd39b6d OBJ: further optimize, cleanup and harden the new C++ importer
Continued improvements to the new C++ based OBJ importer.

Performance: about 2x faster.
- Rungholt.obj (several meshes, 263MB file): Windows 12.7s -> 5.9s, Mac 7.7s -> 3.1s.
- Blender 3.0 splash (24k meshes, 2.4GB file): Windows 97.3s -> 53.6s, Mac 137.3s -> 80.0s.
- "Windows" is VS2022, AMD Ryzen 5950X (32 threads), "Mac" is Xcode/clang 13, M1Max (10 threads).
- Slightly reduced memory usage during import as well.

The performance gains are a combination of several things:
- Replacing `std::stof` / `std::stoi` with C++17 `from_chars`.
- Stop reading input file char-by-char using `std::getline`, and instead read in 64kb chunks, and parse from there (taking care of possibly handling lines split mid-way due to chunk boundaries).
- Removing abstractions for splitting a line by some char,
- Avoid tiny memory allocations: instead of storing a vector of polygon corners in each face, store all the corners in one big array, and per-face only store indices "where do corners start, and how many". Likewise, don't store full string names of material/group names for each face; only store indices into overall material/group names arrays.
- Stop always doing mesh validation, which is slow. Do it just like the Alembic importer does: only do validation if found some invalid faces during import, or if requested by the user via an import setting checkbox (which defaults to off).
- Stop doing "collection sync" for each object being added; instead do the collection sync right after creating all the objects.

Cleanup / Robustness:

This reworking of parser (see "removing abstractions" point above) means that all the functions that were in `parser_string_utils` file are gone, and replaced with different set of functions. However they are not OBJ specific, so as pointed out during review of the previous differential, they are now in `source/blender/io/common` library.

Added gtest coverage for said functions as well; something that was only indirectly covered by obj tests previously.

Rework of some bits of parsing made the parser actually better able to deal with invalid syntax. E.g. previously, if a face corner were a `/123` string, it would have incorrectly treated that as a vertex index (since it would get "hey that's one number" after splitting a string by a slash), instead of properly marking it as invalid syntax.

Added gtest coverage for .mtl parsing; something that was not covered by any tests at all previously.

Reviewed By: Howard Trickey
Differential Revision: https://developer.blender.org/D14586
2022-04-17 22:07:43 +03:00
..
Eigen3
audaspace Merge branch 'blender-v3.1-release' 2022-02-18 18:25:31 +01:00
binreloc File headers: SPDX License migration 2022-02-11 09:14:36 +11:00
bullet2 File headers: SPDX License migration 2022-02-11 09:14:36 +11:00
ceres File headers: SPDX License migration 2022-02-11 09:14:36 +11:00
clew File headers: SPDX License migration 2022-02-11 09:14:36 +11:00
cuew File headers: SPDX License migration 2022-02-11 09:14:36 +11:00
curve_fit_nd File headers: SPDX License migration 2022-02-11 09:14:36 +11:00
draco File headers: use SPDX license for CMake files 2022-02-11 14:23:56 +11:00
fast_float OBJ: further optimize, cleanup and harden the new C++ importer 2022-04-17 22:07:43 +03:00
fmtlib OBJ: use fmt library instead of sprintf for faster formatting 2022-03-27 14:25:48 +03:00
gflags File headers: SPDX License migration 2022-02-11 09:14:36 +11:00
glew File headers: SPDX License migration 2022-02-11 09:14:36 +11:00
glew-es File headers: SPDX License migration 2022-02-11 09:14:36 +11:00
glog File headers: SPDX License migration 2022-02-11 09:14:36 +11:00
gmock File headers: SPDX License migration 2022-02-11 09:14:36 +11:00
gtest File headers: SPDX License migration 2022-02-11 09:14:36 +11:00
hipew File headers: SPDX License migration 2022-02-11 09:14:36 +11:00
json Blender Libraries: Add JSON Library. 2021-09-22 09:07:09 +02:00
lzma File headers: SPDX License migration 2022-02-11 09:14:36 +11:00
lzo File headers: SPDX License migration 2022-02-11 09:14:36 +11:00
mantaflow File headers: SPDX License migration 2022-02-11 09:14:36 +11:00
nanosvg NanoSVG: Mention the version we use 2021-12-02 18:22:05 +01:00
quadriflow File headers: SPDX License migration 2022-02-11 09:14:36 +11:00
rangetree File headers: SPDX License migration 2022-02-11 09:14:36 +11:00
sdlew File headers: SPDX License migration 2022-02-11 09:14:36 +11:00
smaa_areatex File headers: SPDX License migration 2022-02-11 09:14:36 +11:00
tinygltf Extern: Add modifications diff for TinyGLTF 2021-10-13 20:56:27 +09:00
wcwidth File headers: SPDX License migration 2022-02-11 09:14:36 +11:00
xdnd File headers: SPDX License migration 2022-02-11 09:14:36 +11:00
.clang-format
CMakeLists.txt File headers: SPDX License migration 2022-02-11 09:14:36 +11:00
README Readme file to extern libraries about the attribution document 2020-12-11 18:53:22 +01:00

README

When updating a library remember to:

* Update the README.blender with the corresponding version.
* Update the THIRD-PARTY-LICENSE.txt document