@time println(Core.stdout, "Hello")
Hello
0.000027 seconds
julia> @time println("Hello")
Hello
0.000074 seconds
julia> @time print(Core.stdout, "Hello")
Hello 0.000020 seconds
Why is it 3 times faster [see my follow-up comment, it’s in practice slightly slower], and what are the pros and cons? I think, but not sure, it may not support threading (or rather uses no locking, thus working just out-of-order? avoiding UV lib?)? I see it’s being used for juliac as a current workaround, but should it be used more generally? Apparently neither allocated, but I think that’s a lie, since Julia doesn’t track some hidden allocations of print[ln], and are those allocations reduced with core, or even eliminated?
help?> Core.stdout
│ Warning
│
│ The following bindings may be internal; they may change or be removed in future versions:
│
│ • Core.stdout
Will it be guaranteed to be there, because of juliac?
julia> @time print(Core.CoreSTDOUT, "Hello")
Core.CoreSTDOUTHello 0.000131 seconds (2 allocations: 64 bytes)