aboutsummaryrefslogtreecommitdiff
path: root/toolsrc/include/pch.h
diff options
context:
space:
mode:
authorNicole Mazzuca <mazzucan@outlook.com>2019-08-02 16:49:45 -0700
committernicole mazzuca <mazzucan@outlook.com>2019-08-07 16:51:12 -0700
commite79f0dc5328f28b2b3942e2cd0e9b0c1accca4a1 (patch)
tree2324fcb9eadec792148e02f984525dacb8297883 /toolsrc/include/pch.h
parent65cb5cd00cba333e3a41433058e42a114f61fb78 (diff)
downloadvcpkg-e79f0dc5328f28b2b3942e2cd0e9b0c1accca4a1.tar.gz
vcpkg-e79f0dc5328f28b2b3942e2cd0e9b0c1accca4a1.zip
[vcpkg] Make Filesystem::remove_all faster #7570
I added benchmarks to measure how fast the parallel remove_all code was -- it turns out, about 3x slower than stdfs::remove_all. Since this was the case, I removed all of the parallelism and rewrote it serially, and ended up about 30% faster than stdfs::remove_all (in addition to supporting symlinks). In addition, I did the following three orthogonal changes: - simplified the work queue, basing it on Billy O'Neal's idea - Fix warnings on older versions of compilers in tests, by splitting the pragmas out of pch.h. - Ran clang-format on some files In fixing up remove_all, the following changes were made: - On Windows, regular symlinks and directory symlinks are distinct; as an example, to remove directory symlinks (and junctions, for that matter), one must use RemoveDirectory. Only on Windows, I added new `file_type` and `file_status` types, with `file_type` including a new `directory_symlink` enumerator, and `file_status` being exactly the same as the old one except using the new `file_type`. On Unix, I didn't make that change since they don't make a distinction. - I added new `symlink_status` and `status` functions which use the new `file_status` on Windows. - I made `Filesystem::exists` call `fs::exists(status(p))`, as opposed to the old version which called `stdfs::exists` directly. - Added benchmarks to `vcpkg-test/files.cpp`. They test the performance of `remove_all` on small directories (~20 files), with symlinks and without, and on large directories (~2000 files), with symlinks and without.
Diffstat (limited to 'toolsrc/include/pch.h')
-rw-r--r--toolsrc/include/pch.h12
1 files changed, 2 insertions, 10 deletions
diff --git a/toolsrc/include/pch.h b/toolsrc/include/pch.h
index 15ec25e76..ce2a7c9c5 100644
--- a/toolsrc/include/pch.h
+++ b/toolsrc/include/pch.h
@@ -1,14 +1,6 @@
#pragma once
-#if defined(_MSC_VER) && _MSC_VER < 1911
-// [[nodiscard]] is not recognized before VS 2017 version 15.3
-#pragma warning(disable : 5030)
-#endif
-
-#if defined(__GNUC__) && __GNUC__ < 7
-// [[nodiscard]] is not recognized before GCC version 7
-#pragma GCC diagnostic ignored "-Wattributes"
-#endif
+#include <vcpkg/pragmas.h>
#if defined(_WIN32)
#define NOMINMAX
@@ -38,8 +30,8 @@
#include <cstddef>
#include <cstdint>
#define _SILENCE_EXPERIMENTAL_FILESYSTEM_DEPRECATION_WARNING
-#include <experimental/filesystem>
#include <cstring>
+#include <experimental/filesystem>
#include <fstream>
#include <functional>
#include <iomanip>