Created
September 23, 2011 17:26
-
-
Save wolfsage/1237945 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl | |
use strict; | |
use warnings; | |
my $string = 'x' x (1024 * 1024 * 8); | |
print "Before match\n"; | |
$string =~ /x/; | |
print "After plain match\n"; | |
$string =~ /(x)/; | |
print "After capturing match\n"; | |
__END__ | |
mhorsfall@darmstadtium:~$ perl -d:MemoryTrace::Light tm.pl | |
>> 11608 main, tm.pl (6) used 16752640 bytes | |
Before match | |
After plain match | |
>> 11608 main, tm.pl (14) used 8380416 bytes | |
After capturing match |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment