dagolden/Module-Metadata — pull request #3 by vpit (2012-07-28 17:49:52+00:00)
Title: 40% faster Module::Metadata

I have run Devel::NYTProf against a script of mine that calls Module::Metadata->new_from_file for each .pm file in @INC (that's roughly 2700 files). The profile shows that the hottest sub is _parse_fh(), but IO (by which I mean the "my $line = <$fh>" on line 453) makes only up to 10% of the time spent in this sub. There's room for improvement even without resorting to micro-optimizations.

These two commits make _parse_fh() run about 40% faster by refactoring how POD sections are delimited, and by not calling _parse_version_expression() if the current line does not even contain VERSION. They are a variation of changes I submitted to Module::Load::Conditional a few months ago.

Vincent