This is an automated email from the ASF dual-hosted git repository.

arnabp20 pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/systemds.git


The following commit(s) were added to refs/heads/main by this push:
     new d1c2d91005 [SYSTEMDS-3466] Statistics maintenance for 
MatrixObjectFuture
d1c2d91005 is described below

commit d1c2d9100502e966215b85cf40de136f65e5bb98
Author: Arnab Phani <[email protected]>
AuthorDate: Wed Dec 14 17:19:18 2022 +0100

    [SYSTEMDS-3466] Statistics maintenance for MatrixObjectFuture
---
 .../runtime/controlprogram/context/MatrixObjectFuture.java   | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git 
a/src/main/java/org/apache/sysds/runtime/controlprogram/context/MatrixObjectFuture.java
 
b/src/main/java/org/apache/sysds/runtime/controlprogram/context/MatrixObjectFuture.java
index 6ee9c1953c..6850a05cd3 100644
--- 
a/src/main/java/org/apache/sysds/runtime/controlprogram/context/MatrixObjectFuture.java
+++ 
b/src/main/java/org/apache/sysds/runtime/controlprogram/context/MatrixObjectFuture.java
@@ -19,8 +19,10 @@
 
 package org.apache.sysds.runtime.controlprogram.context;
 
+import org.apache.sysds.api.DMLScript;
 import org.apache.sysds.common.Types.ValueType;
 import org.apache.sysds.runtime.DMLRuntimeException;
+import org.apache.sysds.runtime.controlprogram.caching.CacheStatistics;
 import org.apache.sysds.runtime.controlprogram.caching.MatrixObject;
 import org.apache.sysds.runtime.lineage.LineageCache;
 import org.apache.sysds.runtime.matrix.data.MatrixBlock;
@@ -52,7 +54,15 @@ public class MatrixObjectFuture extends MatrixObject
        }
 
        public MatrixBlock acquireRead() {
-               return acquireReadIntern();
+               long t0 = DMLScript.STATISTICS ? System.nanoTime() : 0;
+               //core internal acquire (synchronized per object)
+               MatrixBlock ret = acquireReadIntern();
+
+               if( DMLScript.STATISTICS ){
+                       long t1 = System.nanoTime();
+                       CacheStatistics.incrementAcquireRTime(t1-t0);
+               }
+               return ret;
        }
 
        private synchronized MatrixBlock acquireReadIntern() {

Reply via email to