Skip to content

Parsec parser #2866

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

Closed
wants to merge 25 commits into from
Closed

Parsec parser #2866

wants to merge 25 commits into from

Conversation

phadej
Copy link
Collaborator

@phadej phadej commented Oct 12, 2015

This WIP:

#2865

TODO:

  • make new second stage using new parser
  • verify that resulting GenericPackageDescription are the same (except the already known exceptions)
  • more warnings in lexer (leading tabs)
  • make a switch

Comments are welcome

@phadej
Copy link
Collaborator Author

phadej commented Oct 12, 2015

On my machine

stack exec cabal-parser-perf perf-old 0   22.59s user 0.85s system 93% cpu 25.045 total
stack exec cabal-parser-perf perf-new 0   8.49s user 0.63s system 93% cpu 9.747 total

Though the performance isn't the goal, but it's nice that it is improved as well!

@23Skidoo
Copy link
Member

Good to see this finally being worked on. Besides CPU, you might also want to look at memory usage.

@phadej phadej force-pushed the new-parser-improvements branch from 10b1353 to 7a684ed Compare October 13, 2015 07:45
@phadej
Copy link
Collaborator Author

phadej commented Oct 13, 2015

% time stack exec cabal-parser-perf -- perf-old 0 ~/Library/Haskell/repo-cache/hackage.haskell.org/00-index.tar +RTS -s
60872
  78,193,743,472 bytes allocated in the heap
   7,196,358,072 bytes copied during GC
     307,703,728 bytes maximum residency (59 sample(s))
      33,123,256 bytes maximum slop
             745 MB total memory in use (0 MB lost due to fragmentation)

                                     Tot time (elapsed)  Avg pause  Max pause
  Gen  0     149740 colls,     0 par    6.776s   7.321s     0.0000s    0.0269s
  Gen  1        59 colls,     0 par    1.005s   1.152s     0.0195s    0.1376s

  INIT    time    0.000s  (  0.000s elapsed)
  MUT     time   14.654s  ( 15.403s elapsed)
  GC      time    7.782s  (  8.473s elapsed)
  EXIT    time    0.000s  (  0.000s elapsed)
  Total   time   22.469s  ( 23.877s elapsed)

  %GC     time      34.6%  (35.5% elapsed)

  Alloc rate    5,335,938,426 bytes per MUT second

  Productivity  65.4% of total user, 61.5% of total elapsed

stack exec cabal-parser-perf -- perf-old 0  +RTS -s  22.56s user 0.74s system 96% cpu 24.083 total
% time stack exec cabal-parser-perf -- perf-new 0 ~/Library/Haskell/repo-cache/hackage.haskell.org/00-index.tar +RTS -s
60849
  35,629,246,056 bytes allocated in the heap
   1,285,198,392 bytes copied during GC
     279,760,096 bytes maximum residency (12 sample(s))
      35,124,400 bytes maximum slop
             636 MB total memory in use (0 MB lost due to fragmentation)

                                     Tot time (elapsed)  Avg pause  Max pause
  Gen  0     68051 colls,     0 par    1.159s   1.290s     0.0000s    0.0029s
  Gen  1        12 colls,     0 par    0.258s   0.363s     0.0302s    0.1150s

  INIT    time    0.000s  (  0.000s elapsed)
  MUT     time    5.943s  (  6.213s elapsed)
  GC      time    1.417s  (  1.652s elapsed)
  EXIT    time    0.003s  (  0.029s elapsed)
  Total   time    7.405s  (  7.895s elapsed)

  %GC     time      19.1%  (20.9% elapsed)

  Alloc rate    5,994,938,780 bytes per MUT second

  Productivity  80.9% of total user, 75.8% of total elapsed

stack exec cabal-parser-perf -- perf-new 0  +RTS -s  7.52s user 0.52s system 98% cpu 8.158 total

@phadej phadej force-pushed the new-parser-improvements branch from a7fe4fe to abcad07 Compare October 16, 2015 03:01
@dcoutts
Copy link
Contributor

dcoutts commented Oct 16, 2015

Great stuff. When you make the final pull req (or update this one) it'd be good to rebase it to squish it into fewer logical patches. My original patch was just a snapshot of my hacking experiment.

Re the TODOs, only 2,3 & 4 need to be done to be able to merge. For the warnings, for feature parity we only need the leading tab warnings I think.

@phadej phadej mentioned this pull request Oct 19, 2015
@phadej
Copy link
Collaborator Author

phadej commented Oct 19, 2015

superseeded by #2879

@phadej phadej closed this Oct 19, 2015
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

Successfully merging this pull request may close these issues.

3 participants