in reply to Re: Parsing Emacs Lisp sexpr?
in thread Parsing Emacs Lisp sexpr?
Nice work! I wonder why you opt to parse this format specifically instead of the generic lisp format though.
As for the speed, it's actually rather on-par with Data::SExpression, which uses Parse::Yapp. I commented out the dumping and then:
% time perl 11115197.pl archive-contents real 0m7.449s user 0m7.036s sys 0m0.413s % time perl -MFile::Slurper=read_text -MData::SExpression -E'$ds=Data::SExpression->new; ($sexp, $text) = $ds->read(read_text "archive-contents.2");' real 0m5.411s user 0m5.386s sys 0m0.025s
archive-contents.2 is just the original file with replaced with ( ), and then the problematic @ atom replaced by "@".
Perl regex or Regexp::Grammars will probably be several times faster.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Parsing Emacs Lisp sexpr?
by choroba (Cardinal) on Apr 10, 2020 at 22:14 UTC | |
by perlancar (Hermit) on Apr 11, 2020 at 00:41 UTC | |
|
Re^3: Parsing Emacs Lisp sexpr?
by perlancar (Hermit) on Apr 10, 2020 at 02:31 UTC | |
|
Re^3: Parsing Emacs Lisp sexpr?
by perlancar (Hermit) on Apr 09, 2020 at 10:44 UTC |