Re: [racket] Profiling memory use

2014-02-13 Thread Robby Findler
There is the sgc collector and there is the --enable-backtrace option to the 3m (default) collector. They can require some work to use, tho. They give you more information from dump-memory-stats, I believe (not sure exactly the status of sgc, tho). Do you find tactical (collect-garbage) calls to a

Re: [racket] Profiling memory use

2014-02-13 Thread Daniel Prager
Makes sense. So -- correct me if I'm wrong ;-) -- my main choices are to use a Custodian to impose a hard memory limit, and/or throw in tactical (collect-garbage)'s to help keep usage down. In terms of profiling where the memory is going, are there any sharper tools than (current-memory-in-use)?

Re: [racket] Profiling memory use

2014-02-13 Thread Daniel Prager
Thanks Robby Can the limit be imposed programmatically, for use from the command-line? Thanks Dan On Fri, Feb 14, 2014 at 9:13 AM, Robby Findler wrote: > current-memory-use is counting all of DrRacket's memory and the user > program memory. The limit, however, includes only the user program'

Re: [racket] Profiling memory use

2014-02-13 Thread Robby Findler
Yes. DrRacket does it. You'd have to use lower-level operations, tho (setting up a custodian with a limit before starting the program you want limited). Robby On Thu, Feb 13, 2014 at 4:22 PM, Daniel Prager wrote: > Thanks Robby > > Can the limit be imposed programmatically, for use from the com

Re: [racket] Profiling memory use

2014-02-13 Thread Robby Findler
current-memory-use is counting all of DrRacket's memory and the user program memory. The limit, however, includes only the user program's memory. Robby On Thu, Feb 13, 2014 at 4:05 PM, Daniel Prager wrote: > Apropos: > > I was wondering why I couldn't limit memory in a Racket program directly >

Re: [racket] Profiling memory use

2014-02-13 Thread Daniel Prager
Apropos: I was wondering why I couldn't limit memory in a Racket program directly -- for running from the command-line -- as distinct from in Dr Racket, but the following transcript shed doubts on Dr Racket: Welcome to DrRacket, version 5.3.6 [3m]. Language: racket; memory limit: *256 MB*. > (/

[racket] Profiling memory use

2014-02-11 Thread Daniel Prager
Is there a good reference to measure and understand Racket memory use? I'm doing a run of scribble and memory use is peaking at over 1 Gb. I expect that I will be able to make modifications to limit use if I can get some informative measurements. Thanks Dan -- *Daniel Prager* Agile/Lean Coac

Re: [racket] Profiling help

2013-07-11 Thread Robby Findler
Nothing comes to mind. If you know where the runtime is supposed to start you might try adding printfs in a few places that print out current-process-milliseconds (put a printf right before the call to profile-thunk too) and see if you can kind of hone in on something. You might find something sur

Re: [racket] Profiling help

2013-07-11 Thread Joe Gibbs Politz
On Thu, Jul 11, 2013 at 5:22 PM, Robby Findler wrote: > Is it possible that the time is being spent in the expander or in other > C-based code that would be hidden from the profiler? I don't know quite what C-based code we might be touching, but I do know that our parser down to a racket/base pro

Re: [racket] Profiling help

2013-07-11 Thread Robby Findler
Is it possible that the time is being spent in the expander or in other C-based code that would be hidden from the profiler? Robby On Thu, Jul 11, 2013 at 4:07 PM, Joe Gibbs Politz wrote: > We're trying to profile some slow running programs in a #lang, and > having some trouble getting believa

[racket] Profiling help

2013-07-11 Thread Joe Gibbs Politz
We're trying to profile some slow running programs in a #lang, and having some trouble getting believable results from the profiler. In particular, it claims that most (e.g. 60-80%) of the time is spent in /usr/lib/racket/collects/profile/main.rkt:29:2 We've tried on up to 15-20 second runs of p

Re: [racket] Profiling mostly macro-generated definitions?

2012-08-28 Thread Robby Findler
Well, here's an example of it working. I don't know what to suggest but to ask if you could make a small program that illustrates it not working and maybe we can go from there to understand why you're seeing what you're seeing. #lang racket (require profile) (define h (make-hash)) (profile (let

Re: [racket] Profiling mostly macro-generated definitions?

2012-08-28 Thread J. Ian Johnson
Not unless that's default behavior. -Ian - Original Message - From: "Robby Findler" To: "J. Ian Johnson" Cc: "users" Sent: Tuesday, August 28, 2012 2:08:15 PM GMT -05:00 US/Canada Eastern Subject: Re: [racket] Profiling mostly macro-generated definit

Re: [racket] Profiling mostly macro-generated definitions?

2012-08-28 Thread Robby Findler
sh-ref, or (more surprisingly) my fixpoint function that does all > the work. It is a defined, named function. > All the functions it rendered contributed 0% to the running time. > > -Ian > > - Original Message - > From: "Robby Findler" > To: "J. Ian

Re: [racket] Profiling mostly macro-generated definitions?

2012-08-28 Thread J. Ian Johnson
-- Original Message - From: "Robby Findler" To: "J. Ian Johnson" Cc: "users" Sent: Tuesday, August 28, 2012 1:23:35 PM GMT -05:00 US/Canada Eastern Subject: Re: [racket] Profiling mostly macro-generated definitions? Whether the functions were created by m

Re: [racket] Profiling mostly macro-generated definitions?

2012-08-28 Thread Robby Findler
Whether the functions were created by macro expansion or not won't matter to the profiler. Maybe these functions are just not showing up in the profile because they don't get called a lot? But if you want to be extra sure, it is possible that if the functions don't have a name (you can check this

[racket] Profiling mostly macro-generated definitions?

2012-08-28 Thread J. Ian Johnson
What is the proper way to get the statistical profiler to be aware of function definitions that are created by macro expansion (in different splicing-syntax-parameterize'd blocks, if that matters)? I have a data flow analysis framework that is parameterized by the Might/Van Horn metafunctions f

Re: [racket] profiling

2011-11-12 Thread Neil Van Dyke
Greg Hendershott wrote at 11/12/2011 10:20 AM: If Neil van Dyke is reading this, I think this would be an excellent topic for your book. What are practical ways to get the benefits of contracts during development, while minimizing or eliminating their cost in production? Is it as simple as "rebu

Re: [racket] profiling

2011-11-12 Thread Robby Findler
I have not tried to profile anything to be sure that I understand what Neil T was talking about, but my experience trying to speed up contracts in the past has led me to believe that most of the slowdown is in creating the wrappers, not checking the predicates (at least for contracts that are close

Re: [racket] profiling

2011-11-12 Thread Greg Hendershott
> - higher-order contracts and contract regions are slow If Neil van Dyke is reading this, I think this would be an excellent topic for your book. What are practical ways to get the benefits of contracts during development, while minimizing or eliminating their cost in production? Is it as simpl

Re: [racket] profiling

2011-11-10 Thread Neil Toronto
Expanding on what Robby said about the statistical profiler (the `profile' module) being more useful: I've found that the statistical profiler more often correctly reports the names and source locations of functions. It also doesn't require compiling your code with profiling enabled - it just w

Re: [racket] profiling

2011-11-10 Thread Adam Shaw
Excellent! This is very helpful -- thanks! Regards, Adam On Nov 10, 2011, at 9:44 AM, Robby Findler wrote: > Turning on profiling is an action in the Language dialog. It needs to > be set up before your program is compiled (which the below doesn't > do). > > Robby

Re: [racket] profiling

2011-11-10 Thread Robby Findler
Turning on profiling is an action in the Language dialog. It needs to be set up before your program is compiled (which the below doesn't do). Robby On Thu, Nov 10, 2011 at 9:34 AM, Adam Shaw wrote: > Thanks -- although when I tried this a dialog popped up saying "There is no > profiling informa

Re: [racket] profiling

2011-11-10 Thread Adam Shaw
Thanks -- although when I tried this a dialog popped up saying "There is no profiling information available. Please be sure that profiling is enabled..." So, I added two lines of code above the def'n of even?: (require errortrace) (profiling-enabled #t) Same dialog pops up even so. Regards, A

Re: [racket] profiling

2011-11-10 Thread Robby Findler
Sorry, just 'profile'. Robby On Thu, Nov 10, 2011 at 9:32 AM, Robby Findler wrote: > There's also the (probably more useful) racket/profile library that > uses sampling. > > Robby > > On Thu, Nov 10, 2011 at 9:28 AM, Shriram Krishnamurthi > wrote: >> Here's a program: >> >> #lang racket >> >>

Re: [racket] profiling

2011-11-10 Thread Robby Findler
There's also the (probably more useful) racket/profile library that uses sampling. Robby On Thu, Nov 10, 2011 at 9:28 AM, Shriram Krishnamurthi wrote: > Here's a program: > > #lang racket > > (define (even? n) >  (if (zero? n) true (odd? (sub1 n > > (define (odd? n) >  (if (zero? n) false (

Re: [racket] profiling

2011-11-10 Thread Shriram Krishnamurthi
Here's a program: #lang racket (define (even? n) (if (zero? n) true (odd? (sub1 n (define (odd? n) (if (zero? n) false (even? (sub1 n Go to Language | Choose Language, click on Show Details, and at the top-right, select "Debugging and profiling". Now run the program and in the inte

[racket] profiling

2011-11-10 Thread Adam Shaw
Can someone point me to instructions and/or tutorial materials on how to profile programs in DrRacket? I would appreciate it. Thanks! Regards, Adam _ For list-related administrative tasks: http://lists.racket-lang.org/listinfo/users