diff --git a/cpp/core/shuffle/rss/RssPartitionWriter.cc b/cpp/core/shuffle/rss/RssPartitionWriter.cc index 72bcf1d3a4b0..15981bf8ded8 100644 --- a/cpp/core/shuffle/rss/RssPartitionWriter.cc +++ b/cpp/core/shuffle/rss/RssPartitionWriter.cc @@ -56,8 +56,6 @@ arrow::Status RssPartitionWriter::evict( bool reuseBuffers, bool hasComplexType) { rawPartitionLengths_[partitionId] += inMemoryPayload->getBufferSize(); - - ScopedTimer timer(&spillTime_); auto payloadType = (codec_ && inMemoryPayload->numRows() >= options_.compressionThreshold) ? Payload::Type::kCompressed : Payload::Type::kUncompressed; @@ -69,6 +67,7 @@ arrow::Status RssPartitionWriter::evict( payload = nullptr; // Invalidate payload immediately. // Push. + ScopedTimer timer(&spillTime_); ARROW_ASSIGN_OR_RAISE(auto buffer, rssBufferOs->Finish()); bytesEvicted_[partitionId] += rssClient_->pushPartitionData( partitionId, reinterpret_cast(const_cast(buffer->data())), buffer->size());