Changeset: 0369d975fcec for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=0369d975fcec
Modified Files:
        MonetDB5/src/mal/mal_interpreter.mx
Branch: Oct2010
Log Message:

DFLOWscheduler(): check cheaper condition before more expensive condition

Assuming that condition
( flow->stk->admit == 0 || (*flow->stk->admit)(flow->cntxt, flow->mb, 
flow->stk, p) ) )
is cheaper to evaluate than condition
DFLOWeligible(flow,fs,i,p,pc)
we now evaluate the former before the latter.

Only minor improvements for tests sql/src/test/rdf/Tests/q?_v.sql .


diffs (26 lines):

diff -r c0a9461c941d -r 0369d975fcec MonetDB5/src/mal/mal_interpreter.mx
--- a/MonetDB5/src/mal/mal_interpreter.mx       Thu Oct 07 14:27:34 2010 +0200
+++ b/MonetDB5/src/mal/mal_interpreter.mx       Thu Oct 07 14:39:18 2010 +0200
@@ -1396,8 +1396,9 @@
                        if (fs[i].status == DFLOWpending ) {
                                p = getInstrPtr(flow->mb, fs[i].pc);
                                for ( j= p->retc; j < p->argc; j++)
-                               if ( getArg(p,j)== oa && 
DFLOWeligible(flow,fs,i,p,pc))
-                                       if(flow->stk->admit == 0 || 
(*flow->stk->admit)(flow->cntxt, flow->mb, flow->stk, p) ) {
+                               if ( getArg(p,j)== oa &&
+                                    ( flow->stk->admit == 0 || 
(*flow->stk->admit)(flow->cntxt, flow->mb, flow->stk, p) ) )
+                                       if ( DFLOWeligible(flow,fs,i,p,pc) ) {
                                                queued++;
                                                todo++;
                                                candidates ++;
@@ -1410,8 +1411,8 @@
                for(i = limit-1 ; i >= pc && (candidates == 0 && queued < 
flow->nway) ; i--)
                        if (fs[i].status == DFLOWpending ) {
                                p = getInstrPtr(flow->mb, fs[i].pc);
-                               if ( DFLOWeligible(flow,fs,i,p,pc))
-                                       if(flow->stk->admit == 0 || 
(*flow->stk->admit)(flow->cntxt, flow->mb, flow->stk, p) ) {
+                               if ( flow->stk->admit == 0 || 
(*flow->stk->admit)(flow->cntxt, flow->mb, flow->stk, p) )
+                                       if ( DFLOWeligible(flow,fs,i,p,pc) ) {
                                                queued++;
                                                todo++;
                                                DFLOWactivate(flow,fs,i,p);
_______________________________________________
Checkin-list mailing list
[email protected]
http://mail.monetdb.org/mailman/listinfo/checkin-list

Reply via email to