From 1acf9f3c486813df807ff6931e56cc13eb26eeaf Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Sun, 23 Aug 2015 18:56:43 +0200 Subject: Store indexes as named databases in the same db. Because we also keep using the same transactions this finally makes the resource somewhat performant. On my system genericresourcebenchmark now processes ~4200 messages per second instead of ~280. --- common/pipeline.cpp | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) (limited to 'common/pipeline.cpp') diff --git a/common/pipeline.cpp b/common/pipeline.cpp index ce4ad41..c5e36ee 100644 --- a/common/pipeline.cpp +++ b/common/pipeline.cpp @@ -441,18 +441,8 @@ void PipelineState::step() d->idle = false; if (d->filterIt.hasNext()) { //TODO skip step if already processed - //FIXME error handling if no result is found auto preprocessor = d->filterIt.next(); - //FIXME this read should not be necessary - //Perhaps simply use entity that is initially stored and synchronously process all filters. (Making the first filter somewhat redundant) - d->pipeline->transaction().scan(d->key, [this, preprocessor](const QByteArray &key, const QByteArray &value) -> bool { - auto entity = Akonadi2::GetEntity(value); - preprocessor->process(*this, *entity); - return false; - }, [this](const Akonadi2::Storage::Error &error) { - ErrorMsg() << "Failed to find value in pipeline: " << error.message; - d->pipeline->pipelineCompleted(*this); - }); + preprocessor->process(*this, d->pipeline->transaction()); } else { //This object becomes invalid after this call d->pipeline->pipelineCompleted(*this); @@ -483,7 +473,7 @@ Preprocessor::~Preprocessor() { } -void Preprocessor::process(const PipelineState &state, const Akonadi2::Entity &) +void Preprocessor::process(const PipelineState &state, Akonadi2::Storage::Transaction &transaction) { processingCompleted(state); } -- cgit v1.2.3