Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/windirstat/llfio.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNiall Douglas (s [underscore] sourceforge {at} nedprod [dot] com) <spamtrap@nedprod.com>2018-07-06 21:07:06 +0300
committerNiall Douglas (s [underscore] sourceforge {at} nedprod [dot] com) <spamtrap@nedprod.com>2018-07-06 21:07:06 +0300
commit302db08dd88a5e77fb40103ed632be1e72066bf1 (patch)
treef59f570917859f7f02c354c86667abf2721d9a85 /programs/benchmark-iostreams
parent6efe2493a65540d3f484a8b7f27d5298d49c9da4 (diff)
More afio => llfio
Diffstat (limited to 'programs/benchmark-iostreams')
-rw-r--r--programs/benchmark-iostreams/main.cpp34
1 files changed, 17 insertions, 17 deletions
diff --git a/programs/benchmark-iostreams/main.cpp b/programs/benchmark-iostreams/main.cpp
index 3e005cdf..b6c5035a 100644
--- a/programs/benchmark-iostreams/main.cpp
+++ b/programs/benchmark-iostreams/main.cpp
@@ -26,11 +26,11 @@ Distributed under the Boost Software License, Version 1.0.
#define MAXBLOCKSIZE (4096)
#define REGIONSIZE (100 * 1024 * 1024)
-#include "../../include/afio/afio.hpp"
+#include "../../include/llfio/llfio.hpp"
#if __has_include("quickcpplib/include/algorithm/small_prng.hpp")
#include "quickcpplib/include/algorithm/small_prng.hpp"
#else
-#include "../../include/afio/v2.0/quickcpplib/include/algorithm/small_prng.hpp"
+#include "../../include/llfio/v2.0/quickcpplib/include/algorithm/small_prng.hpp"
#endif
#include <chrono>
@@ -38,7 +38,7 @@ Distributed under the Boost Software License, Version 1.0.
#include <iostream>
#include <vector>
-namespace afio = LLFIO_V2_NAMESPACE;
+namespace llfio = LLFIO_V2_NAMESPACE;
using QUICKCPPLIB_NAMESPACE::algorithm::small_prng::small_prng;
inline uint64_t ticksclock()
@@ -148,9 +148,9 @@ template <class F> inline void run_test(const char *csv, off_t max_extent, F &&f
int main()
{
{
- auto th = afio::file({}, "testfile", afio::file_handle::mode::write, afio::file_handle::creation::if_needed).value();
+ auto th = llfio::file({}, "testfile", llfio::file_handle::mode::write, llfio::file_handle::creation::if_needed).value();
std::vector<char> buffer(REGIONSIZE, 'a');
- th.write(0, {{(afio::byte *) buffer.data(), buffer.size()}}).value();
+ th.write(0, {{(llfio::byte *) buffer.data(), buffer.size()}}).value();
th.barrier({}, true, true).value();
}
{
@@ -160,8 +160,8 @@ int main()
}
#if 0
{
- std::cout << "Testing latency of afio::file_handle with random malloc/free ..." << std::endl;
- auto th = afio::file({}, "testfile").value();
+ std::cout << "Testing latency of llfio::file_handle with random malloc/free ..." << std::endl;
+ auto th = llfio::file({}, "testfile").value();
std::vector<void *> allocations(1024 * 1024);
small_prng rand;
for(auto &i : allocations)
@@ -169,7 +169,7 @@ int main()
i = malloc(rand() % 4096);
}
run_test("file_handle_malloc_free.csv", 1024 * 1024, [&](unsigned offset, char *buffer, size_t len) {
- th.read(offset, {{(afio::byte *) buffer, len}}).value();
+ th.read(offset, {{(llfio::byte *) buffer, len}}).value();
for(size_t n = 0; n < rand() % 64; n++)
{
size_t i = rand() % (1024 * 1024);
@@ -196,21 +196,21 @@ int main()
}
#endif
{
- std::cout << "Testing latency of afio::file_handle ..." << std::endl;
- auto th = afio::file({}, "testfile").value();
- run_test("file_handle.csv", REGIONSIZE, [&](unsigned offset, char *buffer, size_t len) { th.read(offset, {{(afio::byte *) buffer, len}}).value(); });
+ std::cout << "Testing latency of llfio::file_handle ..." << std::endl;
+ auto th = llfio::file({}, "testfile").value();
+ run_test("file_handle.csv", REGIONSIZE, [&](unsigned offset, char *buffer, size_t len) { th.read(offset, {{(llfio::byte *) buffer, len}}).value(); });
}
#if 1
{
- std::cout << "Testing latency of afio::mapped_file_handle ..." << std::endl;
- auto th = afio::mapped_file({}, "testfile").value();
- run_test("mapped_file_handle.csv", REGIONSIZE, [&](unsigned offset, char *buffer, size_t len) { th.read(offset, {{(afio::byte *) buffer, len}}).value(); });
+ std::cout << "Testing latency of llfio::mapped_file_handle ..." << std::endl;
+ auto th = llfio::mapped_file({}, "testfile").value();
+ run_test("mapped_file_handle.csv", REGIONSIZE, [&](unsigned offset, char *buffer, size_t len) { th.read(offset, {{(llfio::byte *) buffer, len}}).value(); });
}
#endif
#if 1
{
std::cout << "Testing latency of memcpy ..." << std::endl;
- auto th = afio::map(REGIONSIZE).value();
+ auto th = llfio::map(REGIONSIZE).value();
#if 1
{
// Prefault
@@ -226,7 +226,7 @@ int main()
memcpy(buffer, th.address() + offset, len);
#else
// Can't use memcpy, it gets elided
- const afio::byte *__restrict s = th.address() + offset;
+ const llfio::byte *__restrict s = th.address() + offset;
#if defined(__SSE2__) || defined(_M_X64) || (defined(_M_IX86_FP) && _M_IX86_FP >= 2)
while(len >= 4 * sizeof(__m128i))
{
@@ -288,5 +288,5 @@ int main()
});
}
#endif
- afio::filesystem::remove("testfile");
+ llfio::filesystem::remove("testfile");
}