Skip to content

DelimitedFiles readdlm is externally slow for Complex{Float64}  #35721

@yzcj105

Description

@yzcj105
 using DelimitedFiles
A = randn(Complex{Float64},300,30)
B = randn(Float64,300,30)
writedlm("A.csv",A,',')
writedlm("B.csv",B,',')
 @time readdlm("A.csv",',',Complex{Float64},'\n')
 10.645386 seconds (67.52 k allocations: 3.250 GiB, 2.68% gc time)
@time readdlm("B.csv",',',Float64,'\n')
  0.005304 seconds (18.00 k allocations: 878.875 KiB)

The readdlm for Complex{Float64} is much much slower and memory requiring compared to real numbers.
I've also compared the time consuming of pandas.read_csv in python, pandas is very fast every for complex numbers.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions