<p dir="auto"><code class="notranslate">skipchars</code> took a 5x preformance hit (for the benchmark we have in BaseBenchmarks) presumably after the introduction of locks on the <code class="notranslate">write</code> calls.</p>
<p dir="auto">Perhaps we can lock outside of the loop and write without a lock and finally unlock it when we are done?</p>
<p dir="auto">I'm noticing an order-of-magnitude slowdown in a custom function to parse "sample list" files (one ASCII value per line) to Float32 arrays. Any ideas what could be causing this?</p>
<p dir="auto">Offending function here: <a href="https://github.com/jpjones76/SeisIO.jl/blob/master/src/Utils/Parsing/streams.jl">https://github.com/jpjones76/SeisIO.jl/blob/master/src/Utils/Parsing/streams.jl</a></p>
<p dir="auto">Affects my ASCII readers for SLIST and Lennartz SLIST files.</p>
<p dir="auto">Before 1.3.0, <code class="notranslate">X[i] = stream_float(io, 0x00)</code> was 2-3x faster than <code class="notranslate">v = readline(io); X[i] = parse(Float32, v)</code>. Now <code class="notranslate">stream_float</code> is 4x slower than <code class="notranslate">readline</code> + <code class="notranslate">parse</code>. I actually need the old speeds if possible, so any alternate syntax suggestions would be welcomed.</p>
<p dir="auto">MWE</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="using Pkg; Pkg.add(&quot;BenchmarkTools&quot;); Pkg.add(&quot;SeisIO&quot;) 
run(`wget https://github.com/jpjones76/SeisIO-TestData/raw/master/SampleFiles/ASCII/0215162000.c00`)
using BenchmarkTools
import SeisIO:stream_float
io = open(&quot;0215162000.c00&quot;, &quot;r&quot;)
nx = 225000
X = zeros(Float32, nx) 
@benchmark (seekstart($io); readline($io); @inbounds for i in 1:$nx; $X[i] = stream_float($io, 0x00); end)"><pre class="notranslate"><code class="notranslate">using Pkg; Pkg.add("BenchmarkTools"); Pkg.add("SeisIO") 
run(`wget https://github.com/jpjones76/SeisIO-TestData/raw/master/SampleFiles/ASCII/0215162000.c00`)
using BenchmarkTools
import SeisIO:stream_float
io = open("0215162000.c00", "r")
nx = 225000
X = zeros(Float32, nx) 
@benchmark (seekstart($io); readline($io); @inbounds for i in 1:$nx; $X[i] = stream_float($io, 0x00); end)
</code></pre></div>
<p dir="auto">Example outputs follow. I benchmarked this on a Dell laptop running Ubuntu 18.04 (bionic), kernel 5.0.0-37-generic, CPU Intel(R) Core(TM) i7-6820HQ CPU @ 2.70GHz, 16 GB RAM.</p>
<p dir="auto">Julia 1.0.5</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="BenchmarkTools.Trial: 
  memory estimate:  272 bytes
  allocs estimate:  2
  --------------
  minimum time:     25.533 ms (0.00% GC)
  median time:      25.701 ms (0.00% GC)
  mean time:        25.867 ms (0.00% GC)
  maximum time:     30.592 ms (0.00% GC)
  --------------
  samples:          194
  evals/sample:     1"><pre class="notranslate"><code class="notranslate">BenchmarkTools.Trial: 
  memory estimate:  272 bytes
  allocs estimate:  2
  --------------
  minimum time:     25.533 ms (0.00% GC)
  median time:      25.701 ms (0.00% GC)
  mean time:        25.867 ms (0.00% GC)
  maximum time:     30.592 ms (0.00% GC)
  --------------
  samples:          194
  evals/sample:     1
</code></pre></div>
<p dir="auto">Julia 1.2.0:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="  memory estimate:  272 bytes
  allocs estimate:  2
  --------------
  minimum time:     24.738 ms (0.00% GC)
  median time:      24.850 ms (0.00% GC)
  mean time:        24.910 ms (0.00% GC)
  maximum time:     27.172 ms (0.00% GC)
  --------------
  samples:          201
  evals/sample:     1"><pre lang="BenchmarkTools.Trial:" class="notranslate"><code class="notranslate">  memory estimate:  272 bytes
  allocs estimate:  2
  --------------
  minimum time:     24.738 ms (0.00% GC)
  median time:      24.850 ms (0.00% GC)
  mean time:        24.910 ms (0.00% GC)
  maximum time:     27.172 ms (0.00% GC)
  --------------
  samples:          201
  evals/sample:     1
</code></pre></div>
<p dir="auto">Julia 1.3.0:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="BenchmarkTools.Trial: 
  memory estimate:  272 bytes
  allocs estimate:  2
  --------------
  minimum time:     236.738 ms (0.00% GC)
  median time:      237.059 ms (0.00% GC)
  mean time:        237.833 ms (0.00% GC)
  maximum time:     245.997 ms (0.00% GC)
  --------------
  samples:          22
  evals/sample:     1"><pre class="notranslate"><code class="notranslate">BenchmarkTools.Trial: 
  memory estimate:  272 bytes
  allocs estimate:  2
  --------------
  minimum time:     236.738 ms (0.00% GC)
  median time:      237.059 ms (0.00% GC)
  mean time:        237.833 ms (0.00% GC)
  maximum time:     245.997 ms (0.00% GC)
  --------------
  samples:          22
  evals/sample:     1
</code></pre></div>