Thanks, Tony. Moving to Julia 0.4.5 improved speed to ~0.025 seconds per megabyte (~39Mb / sec). This is still far behind awesome 2.5Gb for Julia 0.5, but I think it doesn't make sense to spend time on identifying and backporting changes to 0.4 given stated release date for 0.5 [1].
[1]: https://github.com/JuliaLang/julia/milestones On Thursday, June 16, 2016 at 1:20:46 AM UTC+3, Tony Kelman wrote: > > Use 0.4.4 or 0.4.5. https://github.com/JuliaLang/julia/issues/14467 > > On Wednesday, June 15, 2016 at 1:46:34 PM UTC-7, Andrei Zh wrote: >> >> Seems like results I posted are specific to Julia 0.4 (0.4.1 to be >> precise), here are results for Julia 0.3 (about 10 times faster): >> >> elapsed time: 0.031528334 seconds (1048640 bytes allocated) >> elapsed time: 0.031559074 seconds (1048640 bytes allocated) >> elapsed time: 0.031342995 seconds (1048640 bytes allocated) >> elapsed time: 0.031462577 seconds (1048640 bytes allocated) >> elapsed time: 0.031317323 seconds (1048640 bytes allocated) >> elapsed time: 0.032238497 seconds (1048640 bytes allocated) >> elapsed time: 0.031747699 seconds (1048640 bytes allocated) >> elapsed time: 0.032849825 seconds (1048640 bytes allocated) >> elapsed time: 0.031415585 seconds (1048640 bytes allocated) >> elapsed time: 0.031334191 seconds (1048640 bytes allocated) >> elapsed time: 0.033120056 seconds (1049168 bytes allocated) >> elapsed time: 0.032014831 seconds (1048640 bytes allocated) >> elapsed time: 0.031040683 seconds (1048640 bytes allocated) >> elapsed time: 0.031430475 seconds (1048640 bytes allocated) >> elapsed time: 0.031396017 seconds (1048640 bytes allocated) >> >> and for Julia 0.5 (about 1000 times faster, 2.5Gb/sec): >> >> 0.000392 seconds (114 allocations: 1.012 MB) >> 0.000386 seconds (114 allocations: 1.012 MB) >> 0.000412 seconds (114 allocations: 1.012 MB) >> 0.000384 seconds (114 allocations: 1.012 MB) >> 0.000394 seconds (114 allocations: 1.012 MB) >> 0.000398 seconds (114 allocations: 1.012 MB) >> 0.000409 seconds (114 allocations: 1.012 MB) >> 0.000400 seconds (114 allocations: 1.012 MB) >> 0.000396 seconds (114 allocations: 1.012 MB) >> 0.000386 seconds (114 allocations: 1.012 MB) >> 0.000390 seconds (114 allocations: 1.012 MB) >> 0.000727 seconds (114 allocations: 1.012 MB, 46.14% gc time) >> 0.000398 seconds (114 allocations: 1.012 MB) >> 0.000386 seconds (114 allocations: 1.012 MB) >> 0.000395 seconds (114 allocations: 1.012 MB) >> 0.000400 seconds (114 allocations: 1.012 MB) >> >> Any suggestions on why the results are so different and how to fix TCP >> sockets for Julia 0.4? >> >> On Wednesday, June 15, 2016 at 5:10:12 PM UTC+3, Andrei Zh wrote: >>> >>> I've just tested performance of TCP server/client in Julia REPL and find >>> results pretty disappointing. The server is as simple as: >>> >>> server = listen(2000) >>> while true >>> sock = accept(server) >>> begin >>> while true >>> @time readbytes(sock, 1024*1024) >>> end >>> end >>> end >>> >>> It listens on 2000 port for a single connection and than starts reading >>> from it chunks of 1Mb. >>> >>> Client is not much harder: >>> >>> sock = connect(2000) >>> Mb = rand(UInt8, 1024*1024) # 1 Mb of data >>> for i=1:1_000 write(sock, Mb) end >>> >>> Basically it simply writes 1Gb of data in chunk of 1Mb. When I run these >>> snippets in 2 different REPL windows, from the server one I get the >>> following: >>> >>> 0.393481 seconds (2 allocations: 1.000 MB) >>> 0.406101 seconds (2 allocations: 1.000 MB) >>> 0.424946 seconds (2 allocations: 1.000 MB) >>> 0.410651 seconds (2 allocations: 1.000 MB) >>> 0.406987 seconds (2 allocations: 1.000 MB) >>> 0.386872 seconds (2 allocations: 1.000 MB) >>> 0.399998 seconds (40 allocations: 1.001 MB) >>> >>> I.e. speed of data transfer is about 2.5 Mb/sec. I'm pretty much sure my >>> local network interface can do much better. Am I doing something wrong? >>> >>> >>> >>> >>>