I reduced the problem to this line!
write(line_buf, line)
If I change it to:
write(line_buf, string(line))
Everything is MUCH faster. I just cannot tell why this is happening.
I solved by adding the following to the package:
let
io = IOBuffer()
write(io, SubString("test", 1, 4))
end