Skip to content

Instantly share code, notes, and snippets.

@karupanerura
Created July 17, 2015 02:00
Show Gist options
  • Save karupanerura/fa79ea9bd431f7221ecd to your computer and use it in GitHub Desktop.
Save karupanerura/fa79ea9bd431f7221ecd to your computer and use it in GitHub Desktop.
YAPC::EU 2015 - Optimize Perl5 code for performance freaks.

No reason. We just need code that makes processing faster! Yes! We are performance freak.

In this talk, I'll talk about tips of how to write code in perl that makes processing faster.

Topics:

  • XS vs PP implementation
    • Example: DateTime vs Time::Piece vs Time::Moment
    • Example: Time::Strptime
  • Instance cache
    • How to cache URI instance?
    • How to cache DateTime instance?
  • Suppress memory copy.
    • use constant.pm
    • alias of value. (e.g. @_, Scalar::Alias, experimental::refaliasing)
  • Pros and cons of a string eval.
    • Example: Apache::LogFormat::Compiler
  • Optimize regular expressions
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment