I've been trying out nanopass 
(https://github.com/nanopass/nanopass-framework-racket) and its tutorial 
scheme-to-c compiler (https://github.com/LeifAndersen/racket-to-c). However, 
Racket takes easily 20s to bytecompile the c compiler, which is totally 
unacceptable, especially with Racket's normal flow of resetting the environment 
on every compile.

How can I profile this so I can figure out what's taking so long? "raco make 
--vv" is totally uninformative and I don't see any profiling library for macros.

To be clear, I'm not specifically worried about nanopass or this compiler as 
such, but about trying similar macro-heavy strategies to implement languages 
later. Typed Racket has similar huge performance problems, so I'm actually 
worried about fundamental limitations of Racket as a host.

However, TR is far too big for me to poke around in (I tried). I mostly get 
what nanopass is doing though, and the slowness is more surprising, so I 
thought it would make a better starting point for learning how to improve macro 
performance.

So first step: measure what the compiler is actually doing. :)

I thought I might just be able to essentially call:

    (require compiler/compile-file)
    (compile-file "c.rkt") 

and then normally profile that, but compile-file seems to choke on the #lang.

After more reading, tried this:

    (require compiler/cm)
    (require profile)
    (profile (managed-compile-zo "./c.rkt"))

which I can run with racket, but which gives me totally opaque profiling data. 
(Ditto with errortrace on.) (And I can't get it to run in DrRacket at all 
because it doesn't understand PWD or something.)

-- 
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.
For more options, visit https://groups.google.com/d/optout.

Reply via email to