Which is also around 300% faster:
Rate had-hoc sprintf
had-hoc 3508772/s -- -75%
sprintf 14084507/s 301% --
Change-Id: I5ebce0058473f9de08c381739646a20e42308a8f
(cherry picked from commit 561e36d08c)
mr7.5.5
parent
02d0d69f21
commit
e49f5fbb33
@ -0,0 +1,30 @@
|
||||
#!/usr/bin/perl
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
use Test::More tests => 4;
|
||||
|
||||
require_ok('NGCP::BulkProcessor::Utils');
|
||||
|
||||
NGCP::BulkProcessor::Utils->import(qw(
|
||||
zerofill
|
||||
));
|
||||
|
||||
# zerofill()
|
||||
is(zerofill(0, 4), '0000');
|
||||
is(zerofill(25, 4), '0025');
|
||||
is(zerofill(1000, 4), '1000');
|
||||
Loading…
Reference in new issue