Thanks Ryan, the macro profiler is great! It quickly identified a macro 
that I was able to convert to a procedure. (I'm not sure why I made it a 
macro in the first place.) And the .zo file decreased from about 910KB to 
130KB, and the compilation speed went from 40 seconds to about 8 seconds 
(with debugging). I can probably do even better, but fixing this first big 
problem was quite a relief!

On Monday, July 20, 2020 at 8:42:57 AM UTC-5, Ryan Culpepper wrote:
>
> One thing to check is the size of the resulting bytecode file. When I 
> compiled it, I got a 911 KB .zo file. So the most likely reason is that 
> your macros are just producing a lot of code.
>
> You can run the macro profiler (eg, `raco macro-profiler aw-schema.rkt`) 
> to get a summary of what macros contribute most to the compiled code size. 
> See 
> https://docs.racket-lang.org/macro-debugger/index.html#(part._.Macro_.Profiler)
>  
> for more details. I also gave a talk about the macro profiler called "The 
> Cost of Sugar" a few years ago at RacketCon. The slides are at 
> http://www.ccs.neu.edu/home/ryanc/talks/racket18-sugar.pdf, and there 
> should be a recording online somewhere.
>
> The usual fix is to use helper functions. There are some examples in the 
> slides.
>
> Ryan
>

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/1b403370-3382-42a4-9ce1-8a168e3121cao%40googlegroups.com.

Reply via email to