Context Navigation


This page demonstrates the difference in memory and time between using everywhere and Adam's custom traversal. Here is an "unmodified" profile of Tock, dated as per the graph (minus the dependence graph for passes):

attachment:tock-cgtest02.png attachment:tock-cgtest02.pdf

Run-time: 29.48 secs (as measured by the profiler)

As you can see, the top five bands (functions) take up a significant chunk of memory. They belong to three passes; identifyParProcs and transformWaitFor (both in BackendPasses), and replaceNames (in Unnest). At first (not being totally confident as to how the memory accounting works), I thought it might be that everywhere evaluates the entire AST, and thus gets "blamed" for the strict evaluation of the tree. But this explanation doesn't fit; identifyParProces and transformWaitFor are run as consecutive passes, so the latter of the two would not get blamed. A change to these two passes reveals the difference:

attachment:tock-cgtest02-changed-BackendPasses.png attachment:tock-cgtest02-changed-BackendPasses.pdf

Run-time: 19.54 secs (as measured by the profiler)

As you can see, the four bands related to those passes flatten by changing them from using everywhere to using Adam's makeGeneric traversal. Finally, once replaceNames is changed, the memory profile looks much healthier:

attachment:tock-cgtest02-changed-Unnest.png attachment:tock-cgtest02-changed-Unnest.pdf

Run-time: 16.44 secs (as measured by the profiler)

The conclusion is clear; never use everywhere or everywhereM (at least not in tock itself -- using it in the tests should be ok).

Last modified 18 years ago Last modified on Feb 23, 2008, 9:26:14 PM

Attachments (6)

Download all attachments as: .zip

Note: See TracWiki for help on using the wiki.

AltStyle によって変換されたページ (->オリジナル) /