Changeset: d708843284fc for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=d708843284fc
Modified Files:
        monetdb5/modules/mal/Tests/manifold.mal
        monetdb5/modules/mal/Tests/manifold.stable.out
        monetdb5/modules/mal/Tests/manifoldstr.mal
        monetdb5/modules/mal/Tests/manifoldstr.stable.out
Branch: default
Log Message:

Avoid manifold expansion
The traditional MAL loop should be retained for
performance comparisons.


diffs (184 lines):

diff --git a/monetdb5/modules/mal/Tests/manifold.mal 
b/monetdb5/modules/mal/Tests/manifold.mal
--- a/monetdb5/modules/mal/Tests/manifold.mal
+++ b/monetdb5/modules/mal/Tests/manifold.mal
@@ -30,8 +30,15 @@ s:= aggr.sum(z);
 io.printf("#sum %f\n",s);
 
 
+#x:bat[:oid,:dbl]:= mal.multiplex("mmath","sin",b);
 t0:= alarm.usec();
-x:bat[:oid,:dbl]:= mal.multiplex("mmath","sin",b);
+x:= bat.new(:oid,:dbl);
+barrier i:= 0:lng;
+       ii:= algebra.fetch(b,i);
+       d:= mmath.sin(ii);
+       bat.append(x,d);
+       redo i:= iterator.next(1:lng,1000000:lng);
+exit i;
 t1:= alarm.usec();
 d0:= t1-t0;
 io.printf("#mal.multiplex(sin) %d\n",d0);
diff --git a/monetdb5/modules/mal/Tests/manifold.stable.out 
b/monetdb5/modules/mal/Tests/manifold.stable.out
--- a/monetdb5/modules/mal/Tests/manifold.stable.out
+++ b/monetdb5/modules/mal/Tests/manifold.stable.out
@@ -46,14 +46,20 @@ exit i;
     s := aggr.sum(z);
     io.printf("#sum %f\n",s);
     t0 := alarm.usec();
-    x:bat[:oid,:dbl]  := mal.manifold("mmath","sin",b);
+    x := bat.new(:oid,:dbl);
+barrier i := 0:lng;
+    ii := algebra.fetch(b,i);
+    d := mmath.sin(ii);
+    bat.append(x,d);
+    redo i := iterator.next(1:lng,1000000:lng);
+exit i;
     t1 := alarm.usec();
     d0 := calc.-(t1,t0);
     io.printf("#mal.multiplex(sin) %d\n",d0);
     s := aggr.sum(x);
     io.printf("#sum %f\n",s);
     t0 := alarm.usec();
-    x:bat[:oid,:dbl]  := batmmath.sin(b);
+    x := batmmath.sin(b);
     t1 := alarm.usec();
     d0 := calc.-(t1,t0);
     io.printf("#mmath.sin() %d\n",d0);
diff --git a/monetdb5/modules/mal/Tests/manifoldstr.mal 
b/monetdb5/modules/mal/Tests/manifoldstr.mal
--- a/monetdb5/modules/mal/Tests/manifoldstr.mal
+++ b/monetdb5/modules/mal/Tests/manifoldstr.mal
@@ -13,29 +13,37 @@ mdb.setDebug(dbgmsk_set);
 r:= mmath.srand(0);
 barrier i:= 0:lng;
        bat.append(b,"The quick brown fox");
-       redo i:= iterator.next(1:lng,10:lng);
+       redo i:= iterator.next(1:lng,100000:lng);
 exit i;
 
 mdb.setDebug(dbgmsk_restore);
 mdb.setDebug(dbgmsk_set);
 
-io.print(b);
+#io.print(b);
 t0:= alarm.usec();
 z:bat[:oid,:str]:= mal.manifold("str","toUpper",b);
 t1:= alarm.usec();
 d0:= t1-t0;
 io.printf("#mal.manifold(str,toUpper) %d\n",d0);
-io.print(z);
+#io.print(z);
 
 
+# x:bat[:oid,:str]:= mal.multiplex("str","toUpper",b);
 t0:= alarm.usec();
-x:bat[:oid,:str]:= mal.multiplex("str","toUpper",b);
+x:= bat.new(:oid,:str);
+barrier i:= 0:lng;
+       ii:= algebra.fetch(b,i);
+       d:= str.toUpper(ii);
+       bat.append(x,d);
+       redo i:= iterator.next(1:lng,100000:lng);
+exit i;
 t1:= alarm.usec();
 d0:= t1-t0;
 io.printf("#mal.multiplex(str,toUpper) %d\n",d0);
-io.print(x);
+#io.print(x);
 
 
+# No column version available
 #t0:= alarm.usec();
 #x:= str.toUpper(b);
 #t1:= alarm.usec();
diff --git a/monetdb5/modules/mal/Tests/manifoldstr.stable.out 
b/monetdb5/modules/mal/Tests/manifoldstr.stable.out
--- a/monetdb5/modules/mal/Tests/manifoldstr.stable.out
+++ b/monetdb5/modules/mal/Tests/manifoldstr.stable.out
@@ -32,73 +32,39 @@ function user.main():void;
     r := mmath.srand(0);
 barrier i := 0:lng;
     bat.append(b,"The quick brown fox");
-    redo i := iterator.next(1:lng,10:lng);
+    redo i := iterator.next(1:lng,100000:lng);
 exit i;
     mdb.setDebug(dbgmsk_restore);
     mdb.setDebug(dbgmsk_set);
-    io.print(b);
+#io.print(b); 
     t0 := alarm.usec();
     z:bat[:oid,:str]  := mal.manifold("str","toUpper",b);
     t1 := alarm.usec();
     d0 := calc.-(t1,t0);
     io.printf("#mal.manifold(str,toUpper) %d\n",d0);
-    io.print(z);
+#io.print(z); 
+# x:bat[:oid,:str]:= mal.multiplex("str","toUpper",b); 
     t0 := alarm.usec();
-    x:bat[:oid,:str]  := mal.manifold("str","toUpper",b);
+    x := bat.new(:oid,:str);
+barrier i := 0:lng;
+    ii := algebra.fetch(b,i);
+    d := str.toUpper(ii);
+    bat.append(x,d);
+    redo i := iterator.next(1:lng,100000:lng);
+exit i;
     t1 := alarm.usec();
     d0 := calc.-(t1,t0);
     io.printf("#mal.multiplex(str,toUpper) %d\n",d0);
-    io.print(x);
+#io.print(x); 
+# No column version available 
 #t0:= alarm.usec(); 
 #x:= str.toUpper(b); 
 #t1:= alarm.usec(); 
 #d0:= t1-t0; 
 #io.printf("#str.toupper() %d\n",d0); 
 end main;
-#--------------------------#
-# h    t  # name
-# void str  # type
-#--------------------------#
-[ 0@0, "The quick brown fox"  ]
-[ 1@0, "The quick brown fox"  ]
-[ 2@0, "The quick brown fox"  ]
-[ 3@0, "The quick brown fox"  ]
-[ 4@0, "The quick brown fox"  ]
-[ 5@0, "The quick brown fox"  ]
-[ 6@0, "The quick brown fox"  ]
-[ 7@0, "The quick brown fox"  ]
-[ 8@0, "The quick brown fox"  ]
-[ 9@0, "The quick brown fox"  ]
-#mal.manifold(str,toUpper) 55
-#--------------------------#
-# h    t  # name
-# void str  # type
-#--------------------------#
-[ 0@0, "THE QUICK BROWN FOX"  ]
-[ 1@0, "THE QUICK BROWN FOX"  ]
-[ 2@0, "THE QUICK BROWN FOX"  ]
-[ 3@0, "THE QUICK BROWN FOX"  ]
-[ 4@0, "THE QUICK BROWN FOX"  ]
-[ 5@0, "THE QUICK BROWN FOX"  ]
-[ 6@0, "THE QUICK BROWN FOX"  ]
-[ 7@0, "THE QUICK BROWN FOX"  ]
-[ 8@0, "THE QUICK BROWN FOX"  ]
-[ 9@0, "THE QUICK BROWN FOX"  ]
-#mal.multiplex(str,toUpper) 45
-#--------------------------#
-# h    t  # name
-# void str  # type
-#--------------------------#
-[ 0@0, "THE QUICK BROWN FOX"  ]
-[ 1@0, "THE QUICK BROWN FOX"  ]
-[ 2@0, "THE QUICK BROWN FOX"  ]
-[ 3@0, "THE QUICK BROWN FOX"  ]
-[ 4@0, "THE QUICK BROWN FOX"  ]
-[ 5@0, "THE QUICK BROWN FOX"  ]
-[ 6@0, "THE QUICK BROWN FOX"  ]
-[ 7@0, "THE QUICK BROWN FOX"  ]
-[ 8@0, "THE QUICK BROWN FOX"  ]
-[ 9@0, "THE QUICK BROWN FOX"  ]
+#mal.manifold(str,toUpper) 72463
+#mal.multiplex(str,toUpper) 245545
 
 # 10:40:30 >  
 # 10:40:30 >  "Done."
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to