I'm also having similar trouble: compiling a module with a couple of dozen 
`@printf` statements can take 20-30 seconds, but only a few seconds when 
these statements are commented out.

Can you please say a bit more about how the `@printf` call should be 
wrapped in a function?


On Sunday, October 4, 2015 at 1:08:06 PM UTC-7, Stefan Karpinski wrote:
>
> You can try wrapping each printf call in a function. Sorry for that 
> annoyance, it should be fixed but for now that's the workaround.
>
> On Sunday, October 4, 2015, Chris Stook <[email protected] <javascript:>> 
> wrote:
>
>> I am having difficulty troubleshooting a memory allocation problem in a 
>> show method for a user defined type.
>>
>> Compiling the show method with 126 @printf macros takes 197 seconds and 
>> allocates 5.57GB of memory.  The next call takes 0.014 seconds and 
>> allocates 27.141KB.  I moved the type and it's show method to a notebook 
>> here:
>>
>> https://github.com/cstook/julia-printf-memory-allocation
>>
>> Memory allocation for compilation seems to be exponentially related to 
>> the number of @printf macros, but I do not see any particular offending 
>> line.  This was determined by commenting out blocks of code. 
>>
>> What is the best way to troubleshoot a compile time problem?
>>
>> Chris
>>
>

Reply via email to