fertapric / xmap

XML to Map converter
https://hexdocs.pm/xmap
MIT License
4 stars 2 forks source link

XMap.from_xml is going to freeze state for large XML String #4

Open krishna-goteti opened 6 years ago

krishna-goteti commented 6 years ago

For the file large_file.txt.gz when tried to parse using the following, it is going to freeze state.

$ iex -S mix
Erlang/OTP 20 [erts-9.3] [source] [64-bit] [smp:4:4] [ds:4:4:10] [async-threads:10] [hipe] [kernel-poll:false]

Interactive Elixir (1.6.5) - press Ctrl+C to exit (type h() ENTER for help)
iex(1)> File.read!("large_file.txt.gz") |> :zlib.gunzip() |> XMap.from_xml

BREAK: (a)bort (c)ontinue (p)roc info (i)nfo (l)oaded
       (v)ersion (k)ill (D)b-tables (d)istribution
fertapric commented 6 years ago

@krishna-goteti I've spend a few minutes trying to improve the performance but none of my experiments fixed this issue. Depending on your use case, you might want to use :xmerl directly :)