[plt-scheme] Profiling Contracts

From: Dave Herman (dherman at ccs.neu.edu)
Date: Thu Jun 18 12:41:31 EDT 2009

You can write your own wrapper:

#lang scheme/base

(require scheme/contract)
(provide provide/contract*)

(define-syntax provide/contract*
   (syntax-rules ()
     [(_ #:disable [name contract] ...)
      (provide name ...)]
     [(_ . rest)
      (provide/contract . rest)]))


Paulo J. Matos wrote:
> On Thu, Jun 18, 2009 at 2:13 AM, Robby
> Findler<robby at eecs.northwestern.edu> wrote:
>> I would just run the profiler to find out what I find out.
>> But you can always just disable the contracts (define provide/contract
>> to be just provide, after stripping out the contracts) and then see
>> that way.
> That's still some rewriting...
>  It would be nice if it were possible to send a flag to
> provide/contract, such that if it is #t, contracts would not be
> applied at all and provide/contract would behave as provide.
>> Robby
>> On Wed, Jun 17, 2009 at 5:30 PM, Paulo J. Matos<pocmatos at gmail.com> wrote:
>>> Hi all,
>>> Is there a way to profile the time taken checking contracts?
>>> I have used contracts heavily in some parts of my model checker, many
>>> times checking things that are more than simple type checks... and would
>>> like to know if there is an easy way to know, 'hey for this exection, 5%
>>> of the time was spent checking contracts'. If there is nothing
>>> implemented to do this, are there any guidelines on how to find an
>>> approximation of this value?
>>> Cheers,
>>> Paulo Matos
>>> _________________________________________________
>>>  For list-related administrative tasks:
>>>  http://list.cs.brown.edu/mailman/listinfo/plt-scheme

Posted on the users mailing list.