Skip to content

Instantly share code, notes, and snippets.

@mberends
Created March 22, 2009 11:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mberends/83138 to your computer and use it in GitHub Desktop.
Save mberends/83138 to your computer and use it in GitHub Desktop.
Pod::Parser performance (therefore also Pod::Server) is disappointingly
slow when handling medium size (5k-50k) files. Memory usage climbs rapidly
because it seems Parrot or Rakudo leaks memory until the process exits.
The operating system resorts to swapping hectically in a hopeless effort
to provide more, but Parrot doesn't recycle and keeps calling malloc().
After almost hanging the computer for a long time the kernel usually kills
the Parrot.
Running L<Pod::Server|http://github.com/eric256/perl6-examples/blob/master/lib/Pod/Server.pm>
and L<Pod::Parser|http://github.com/eric256/perl6-examples/blob/master/lib/Pod/Parser.pm>
causes huge memory and CPU loads. Some approximate Pod::Server responses:
Document size time RAM
rakudo/docs/compiler_overview.pod 9k 54s 224M
rakudo/docs/glossary.pod 4k 19s 132M
rakudo/docs/guide_to_setting.pod 3k 15s 114M
rakudo/docs/release_guide.pod 1k 5s 94M
pugs/docs/Perl6/Spec/S01-overview.pod 5k 28s 158M
pugs/docs/Perl6/Spec/S02-bits.pod 151k 600s 1583M (died)
pugs/docs/Perl6/Spec/S03-operators.pod 150k
pugs/docs/Perl6/Spec/S04-control.pod 58k 340s 1048M (died)
pugs/docs/Perl6/Spec/S05-regex.pod 133k
pugs/docs/Perl6/Spec/S06-routine.pod 113k
pugs/docs/Perl6/Spec/S07-iterators.pod 7k 35s 174M
pugs/docs/Perl6/Spec/S09-data.pod 46k 255s 820M (died)
pugs/docs/Perl6/Spec/S10-packages.pod 8k 49s 204M
pugs/docs/Perl6/Spec/S10-modules.pod 22k 137s 433M
Results on a dual core amd64 4200+, 2GB memory, running Linux. Only one
CPU core runs each process :(
Seeing memory use up to 15000 times document size is worrying.
The developer guidelines that apply to Java and .NET probably apply to
Rakudo as well - keep the application code small and shift as much of
the heavy processing burden as possible to the standard libraries of the
language.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment