From d0dc39551f72e7e1e7738ba84f96b30a54d1b949 Mon Sep 17 00:00:00 2001 From: Christopher Rackauckas Date: Sat, 29 Aug 2020 00:49:59 -0400 Subject: [PATCH] Don't lock threads MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit On v1.3 if you are opening paths the I/O was made thread-safe by default, but if you don't need thread-safety it can be faster to ignore the I/O locks. See https://github.com/JuliaLang/julia/issues/34195 for details. This fixes the performance post v1.3: Before: ```julia 689.599 μs (15 allocations: 347.34 KiB) ``` After: ```julia 243.900 μs (15 allocations: 347.34 KiB) ``` --- julia/stl.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/julia/stl.jl b/julia/stl.jl index 1ae929d..03aa099 100644 --- a/julia/stl.jl +++ b/julia/stl.jl @@ -16,7 +16,7 @@ struct Triangle end function parse(path::AbstractString) - open(path) do stl + open(path;lock=false) do stl skip(stl, 80) # skip header trianglecount = read(stl, UInt32) ref = Ref{Triangle}()