Ian Watson
unread,Jun 15, 2012, 10:25:18 PM6/15/12Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to juli...@googlegroups.com
I was pleased to find that Julia can do formatted output via the printf function. But I find that the performance of the current implementation makes it unusable.
Consider the programme
for i = 1:10000
x = randn()
println("$(x)")
# printf("%.2f\n", x)
end
Using println, this takes around 2 seconds (including Julia startup time). Using printf, the execution time goes to 102 seconds (including Julia startup time). I was scratching my head trying to figure out why Julia was running more than100x slower than my C++ code. Having short circuited all the computation, I was surprised to find that it was the programme's final I/O that was the killer.
The current implementation looks very elegant, I cannot say I understand it, but there does appear to be some significant performance problems with it. Assuming of course that I am using it properly...
Ian