Blender Git Loki

Git Commits -> Revision 9616e2e

Revision 9616e2e by Ankit Meel (soc-2020-io-performance)
August 8, 2020, 19:42 (GMT)
Use std::string_view for string splitting.

While being slightly more error prone, this change
gives a speedup of 1.9 s vs 1.2 s on a 23.3 MB 8-level
subdivided cube OBJ file. [1] The biggest time sink earlier
was splitting strings into smaller ones. Now it is `std::stof`
about which nothing much can be done.

`StringRef` has been completely removed to avoid
casts between `std::string_view::size_type` & `int64_t`
that `StringRef::size()` gives. Also, `find_{first/last}_{not/}_of`
and `substr` have been used a lot, which are missing in `StrinRef`.

The change also removes `rn` carriage return line breaks
while cleaning up the string.

Use `blender::StringRefNull` where null-terminated strings
are present.

`fprintf` has been replaced with `std::cerr` since
`std::string_view::data()` may give a pointer to a non
null terminated buffer. Also, error logging is not performance
-critical. [2]

[1] See week 7 reports for breakdown on the older timings.
https://wiki.blender.org/wiki/User:Ankitm/GSoC_2020_Daily_Reports#Week_7
[2] https://en.cppreference.com/w/cpp/string/basic_string_view/data

Commit Details:

Full Hash: 9616e2ef78f04b9eb1974f490ba93ca13786fbfe
Parent Commit: 6e419e9
Lines Changed: +98, -66

3 Modified Paths:

/source/blender/io/wavefront_obj/intern/wavefront_obj_im_file_reader.cc (+95, -63) (Diff)
/source/blender/io/wavefront_obj/intern/wavefront_obj_im_file_reader.hh (+1, -1) (Diff)
/source/blender/io/wavefront_obj/intern/wavefront_obj_im_objects.hh (+2, -2) (Diff)
Tehnyt: Miika HämäläinenViimeksi päivitetty: 07.11.2014 14:18MiikaH:n Sivut a.k.a. MiikaHweb | 2003-2021