Open hjunqq opened 2 years ago
Hi @hjunqq
I know, but vtk_fortran_dataarray_encoder is the encoder for ASCII files that are not tailored for a large amount of data.
If you have to write large files I strongly suggest using a raw binary encoder.
Kind regards
I modify the code like that:
size_n = size(x,dim=1)
l = DI1P+1
sp = 0
code = repeat(' ',l*size_n)
do n = 1,size_n
code(sp+1:sp+l) = str(n=x(n))
sp = sp + l
enddo
it has better performance, but doesnot as elegant as the code you wrote.
Hi @hjunqq sorry for my delay. Yes, there is room for improvement, but for the ASCII encoder, I was focused on clearness, conciseness, and maintainability rather than performance just because for larger files the raw-binary encoder is the right option. Anyway, you patch is fine for me.
Kind regards
the code like
in vtk_fortran_dataarray_encoder.f90 takes a long time to execute when a large amount of data needs to be processed