Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ParserCombinator is slow #22

Open
CarloLucibello opened this issue Jan 30, 2017 · 0 comments
Open

ParserCombinator is slow #22

CarloLucibello opened this issue Jan 30, 2017 · 0 comments

Comments

@CarloLucibello
Copy link
Collaborator

I did some perfomance tests for reading a file from a graph using my package FatGraphs;

Pkg.clone("https://github.com/CarloLucibello/FatGraphs.jl")

For comparison I write a graph in a simple text format (Pajek .net). Each of the following function has been run twice to avoid compilations times:

julia> g = Graph(100,1000,seed=1)
Graph{Int64}(100, 1000)

julia> @time writegraph("test.net",g)
  0.243075 seconds (37.02 k allocations: 1.487 MB)
1

julia> @time readgraph("test.net")
  0.003040 seconds (18.54 k allocations: 550.281 KB)
Graph{Int64}(100, 1000)
```
Notice how  perfomance is degraded  when **reading** from a .dot or a .gml file, relying on ParserCombinator:
```julia
julia> @time writegraph("test.dot",g)
  0.001826 seconds (15.23 k allocations: 664.031 KB)
1

julia> @time readgraph("test.dot")
  2.408855 seconds (1.22 M allocations: 49.666 MB, 0.56% gc time)
Graph{Int64}(100, 1000)


julia> @time writegraph("test.gml",g)
  0.001426 seconds (16.83 k allocations: 789.031 KB)
1

julia> @time readgraph("test.gml")
  1.024898 seconds (511.11 k allocations: 18.279 MB, 0.64% gc time)
Graph{Int64}(100, 1000)
```
Probably ParserCombinator has some huge type instability issues. Can those be avoided?

Bye,
Carlo 
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant