summaryrefslogtreecommitdiffstats
path: root/libcxx/benchmarks/filesystem.bench.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Optimize filesystem::path by providing weaker exception guarantees.Eric Fiselier2016-10-311-0/+34
| | | | | | | | | | | | | | path uses string::append to construct, append, and concatenate paths. Unfortunatly string::append has a strong exception safety guaranteed and if it can't prove that the iterator operations don't throw then it will allocate a temporary string copy to append to. However this extra allocation and copy is very undesirable for path which doesn't have the same exception guarantees. To work around this this patch adds string::__append_forward_unsafe which exposes the std::string::append interface for forward iterators without enforcing that the iterator is noexcept. llvm-svn: 285532
* Improve performance of constructing filesystem::path from strings.Eric Fiselier2016-10-301-3/+17
| | | | | | | | | | | | | This patch fixes a performance bug when constructing or appending to a path from a string or c-string. Previously we called 'push_back' to append every single character. This caused multiple re-allocation and copies when at most one reallocation is necessary. The new behavior is to simply call `string::append` so it can correctly handle reallocation. For large strings this change is a ~4x improvement. This also makes our path faster to construct than libstdc++'s. llvm-svn: 285530
* Add start of filesystem benchmarksEric Fiselier2016-10-301-0/+90
llvm-svn: 285524
OpenPOWER on IntegriCloud