Commit cc65b368 authored by Simon Marlow's avatar Simon Marlow
Browse files

count "dud" sparks (expressions that were already evaluated when sparked)

parent d63ba79a
......@@ -225,6 +225,7 @@ initCapability( Capability *cap, nat i )
cap->returning_tasks_tl = NULL;
cap->inbox = (Message*)END_TSO_QUEUE;
cap->sparks_created = 0;
cap->sparks_dud = 0;
cap->sparks_converted = 0;
cap->sparks_pruned = 0;
#endif
......
......@@ -99,6 +99,7 @@ struct Capability_ {
// Stats on spark creation/conversion
nat sparks_created;
nat sparks_dud;
nat sparks_converted;
nat sparks_pruned;
#endif
......
......@@ -71,9 +71,10 @@ newSpark (StgRegTable *reg, StgClosure *p)
if (closure_SHOULD_SPARK(p)) {
pushWSDeque(pool,p);
}
cap->sparks_created++;
cap->sparks_created++;
} else {
cap->sparks_dud++;
}
return 1;
}
......
......@@ -636,16 +636,18 @@ stat_exit(int alloc)
{
nat i;
lnat sparks_created = 0;
lnat sparks_dud = 0;
lnat sparks_converted = 0;
lnat sparks_pruned = 0;
for (i = 0; i < n_capabilities; i++) {
sparks_created += capabilities[i].sparks_created;
sparks_dud += capabilities[i].sparks_dud;
sparks_converted += capabilities[i].sparks_converted;
sparks_pruned += capabilities[i].sparks_pruned;
}
statsPrintf(" SPARKS: %ld (%ld converted, %ld pruned)\n\n",
sparks_created, sparks_converted, sparks_pruned);
statsPrintf(" SPARKS: %ld (%ld converted, %ld dud, %ld pruned)\n\n",
sparks_created + sparks_dud, sparks_converted, sparks_dud, sparks_pruned);
}
#endif
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment