diff --git a/presto-main/src/main/java/com/facebook/presto/operator/exchange/LocalExchangeSinkOperator.java b/presto-main/src/main/java/com/facebook/presto/operator/exchange/LocalExchangeSinkOperator.java
index <HASH>..<HASH> 100644
--- a/presto-main/src/main/java/com/facebook/presto/operator/exchange/LocalExchangeSinkOperator.java
+++ b/presto-main/src/main/java/com/facebook/presto/operator/exchange/LocalExchangeSinkOperator.java
@@ -149,8 +149,8 @@ public class LocalExchangeSinkOperator
     {
         requireNonNull(page, "page is null");
         page = pagePreprocessor.apply(page);
-        sink.addPage(page);
         operatorContext.recordOutput(page.getSizeInBytes(), page.getPositionCount());
+        sink.addPage(page);
     }
 
     @Override
Record operator output before addPage in LocalExchangeSink

This minor change ensures that any Page#getSizeInBytes calculation
work is done inside of LocalExchangeSinkOperator before passing the
page through to LocalExchangeSink, which can be relatively more
expensive to calculate from within the sink since most involve
critical sections and locking. This work would have been done anyway,
but doing it from within the sink operator makes it possible for
that work to be avoided while holding a lock in some contexts on
the other side.