Thread aus array kommas löschen: hilfe ... (11 answers)
Opened by Annka at 2006-08-23 13:38

renee
 2006-08-23 18:25
#69121 #69121
User since
2003-08-04
14371 Artikel
ModeratorIn
[Homepage] [default_avatar]
Code: (dl )
1
2
3
4
5
6
7
8
9
#!/usr/bin/perl

use Benchmark qw(:all);


cmpthese( 10000, {
'regex' => sub {my $string = 'Hallo, Welt blub blub, foo, bar.' x 1000; $string =~ s/,//g; },
'trans' => sub {my $string = 'Hallo, Welt blub blub, foo, bar.' x 1000; $string =~ tr/,//d },
});


Code: (dl )
1
2
3
4
C:\community>bench.pl
Rate regex trans
regex 387/s -- -75%
trans 1534/s 296% --
OTRS-Erweiterungen (http://feature-addons.de/)
Frankfurt Perlmongers (http://frankfurt.pm/)
--

Unterlagen OTRS-Workshop 2012: http://otrs.perl-services.de/workshop.html
Perl-Entwicklung: http://perl-services.de/

View full thread aus array kommas löschen: hilfe ...