🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.prolog
Article #1318

Re: Profiler Availability

#1318
From: Richard A. O'Keefe
Date: Wed, 24 Oct 1990 05:18
27 lines
1724 bytes
In article <YN3R0TB@cs.swarthmore.edu>, plummer@cs.swarthmore.edu (David Barker-Plummer) writes:
> Are there any freely available program profilers out there?  I have a
> (very) large Prolog program and I want to find out which predicates
> are called, and how often, to find out where the time goes.
> Basically, what I am looking for is an interpreter that keeps count of
> calls.  Sure I could write one, but if there's one out there I'd like
> to use it.

> The program in question is in Quintus, in case that matters.

You don't need an interpreter.  There is in fact a tool in the library
which does just what you're asking for:  provide counts of how often
each predicate is called.

	| ?- use_module(library(count)).	% load the package
	| ?- count(foobaz).			% instead of compile(foobaz)
	| ?- clear_counts.			% set all counters to 0
	| ?- run_the_foobaz_code.		% run the code to be profiled
	| ?- write_counts('foobar.cts').	% store the counts in a file

Remember, "use the source!"  If you're still using an old version of the
library, ask Quintus to provide you with count.pl and count.c.

This is nowhere near as good as the profiling facilities built into
SICStus Prolog version 0.7, but it's a start.
-- 
Fear most of all to be in error.	-- Kierkegaard, quoting Socrates.
Technical Details
Message-ID: <4066@goanna.cs.rmit.oz.au>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!watserv1!watmath!att!att!emory!swrinde!zaphod.mps.ohio-state.edu!samsung!munnari.oz.au!goanna!ok
References: <YN3R0TB@cs.swarthmore.edu>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!watserv1!watmath!att!att!emory!swrinde!zaphod.mps.ohio-state.edu!samsung!munnari.oz.au!goanna!ok
From: ok@goanna.cs.rmit.oz.au (Richard A. O'Keefe)
Newsgroups: comp.lang.prolog
Subject: Re: Profiler Availability
Message-ID: <4066@goanna.cs.rmit.oz.au>
Date: 24 Oct 90 05:18:31 GMT
References: <YN3R0TB@cs.swarthmore.edu>
Organization: Comp Sci, RMIT, Melbourne, Australia
Lines: 27