Baunsgaard commented on code in PR #1983:
URL: https://github.com/apache/systemds/pull/1983#discussion_r1495003135


##########
src/main/java/org/apache/sysds/runtime/matrix/data/LibMatrixFourier.java:
##########
@@ -440,4 +444,18 @@ public static MatrixBlock[] ifft_linearized(MatrixBlock 
re, int threads) {
                        threads);
        }
 
+       private static double sin(double angle){
+               if (!sinCache.containsKey(angle)) {

Review Comment:
   please limit the cache to contain only a subset of values (max 1000), since 
the map can grow to large.
   also we need to hide it behind a SoftReference since we want to allow java 
to remove it from memory if we are under memory pressure.
   
   Therefore to use it extract the HashMap and materialize it as a variable 
inside fft_one_dim_sub(), and put that hashmap in as an argument to your calls 
to cos and sin.
   
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@systemds.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to