Skip to content

Commit

Permalink
Add benchmark for fetchData()
Browse files Browse the repository at this point in the history
  • Loading branch information
Kicer86 committed May 7, 2024
1 parent 656aec8 commit 8d07f14
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/database/benchmarks/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,13 @@
#include <QCoreApplication>

void BM_get_photo_delta();
void BM_fetch_photo_delta();


int main(int argc, char** argv)
{
QCoreApplication app(argc, argv);

BM_get_photo_delta();
BM_fetch_photo_delta();
}
13 changes: 13 additions & 0 deletions src/database/benchmarks/photo_fetch_benchmarks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -101,3 +101,16 @@ void BM_get_photo_delta()
"getPhotoDelta()"
);
}


void BM_fetch_photo_delta()
{
for_each_backend(fillBackendWithData, [](Database::IBackend& backend)
{
const auto photos = backend.photoOperator().fetchData(Database::FilterPhotosWithPath("path 1"));

ankerl::nanobench::doNotOptimizeAway(photos);
},
"fetchPhotoDelta()"
);
}

0 comments on commit 8d07f14

Please sign in to comment.