Acme-CPANModules-CalculatingDayOfWeek
view release on metacpan or search on metacpan
"Pod::Coverage::TrustPod" : "0",
"Test::Perl::Critic" : "0",
"Test::Pod" : "1.41",
"Test::Pod::Coverage" : "1.08"
}
},
"runtime" : {
"requires" : {
"Date::Calc" : "0",
"Date::DayOfWeek" : "0",
"DateTime" : "0",
"Time::DayOfWeek" : "0",
"Time::Moment" : "0",
"perl" : "5.010001",
"strict" : "0",
"warnings" : "0"
}
},
"test" : {
"requires" : {
"Bencher::Backend" : "1.063",
"File::Spec" : "0",
"IO::Handle" : "0",
"IPC::Open3" : "0",
"Test::More" : "0"
}
},
"x_benchmarks" : {
"requires" : {
"Date::Calc" : "0",
"Date::DayOfWeek" : "0",
"DateTime" : "0",
"Time::DayOfWeek" : "0",
"Time::Moment" : "0"
},
"x_benchmarks" : {
"Date::Calc" : "0",
"Date::DayOfWeek" : "0",
"DateTime" : "0",
"Time::DayOfWeek" : "0",
"Time::Moment" : "0"
}
},
"x_lists" : {
"x_lists" : {
"Date::Calc" : "0",
"Date::DayOfWeek" : "0",
"DateTime" : "0",
"Time::DayOfWeek" : "0",
"Time::Moment" : "0"
}
},
"x_mentions" : {
"x_mentions" : {
"Date::Calc" : "0",
"Date::DayOfWeek" : "0",
"DateTime" : "0",
"Time::DayOfWeek" : "0",
"Time::Moment" : "0"
}
}
},
"provides" : {
"Acme::CPANModules::CalculatingDayOfWeek" : {
"file" : "lib/Acme/CPANModules/CalculatingDayOfWeek.pm",
"version" : "0.002"
}
url: http://module-build.sourceforge.net/META-spec-v1.4.html
version: '1.4'
name: Acme-CPANModules-CalculatingDayOfWeek
provides:
Acme::CPANModules::CalculatingDayOfWeek:
file: lib/Acme/CPANModules/CalculatingDayOfWeek.pm
version: '0.002'
requires:
Date::Calc: '0'
Date::DayOfWeek: '0'
DateTime: '0'
Time::DayOfWeek: '0'
Time::Moment: '0'
perl: '5.010001'
strict: '0'
warnings: '0'
resources:
bugtracker: https://rt.cpan.org/Public/Dist/Display.html?Name=Acme-CPANModules-CalculatingDayOfWeek
homepage: https://metacpan.org/release/Acme-CPANModules-CalculatingDayOfWeek
repository: git://github.com/perlancar/perl-Acme-CPANModules-CalculatingDayOfWeek.git
version: '0.002'
Makefile.PL view on Meta::CPAN
"CONFIGURE_REQUIRES" => {
"ExtUtils::MakeMaker" => 0
},
"DISTNAME" => "Acme-CPANModules-CalculatingDayOfWeek",
"LICENSE" => "perl",
"MIN_PERL_VERSION" => "5.010001",
"NAME" => "Acme::CPANModules::CalculatingDayOfWeek",
"PREREQ_PM" => {
"Date::Calc" => 0,
"Date::DayOfWeek" => 0,
"DateTime" => 0,
"Time::DayOfWeek" => 0,
"Time::Moment" => 0,
"strict" => 0,
"warnings" => 0
},
"TEST_REQUIRES" => {
"Bencher::Backend" => "1.063",
"File::Spec" => 0,
"IO::Handle" => 0,
"IPC::Open3" => 0,
Makefile.PL view on Meta::CPAN
"test" => {
"TESTS" => "t/*.t"
}
);
my %FallbackPrereqs = (
"Bencher::Backend" => "1.063",
"Date::Calc" => 0,
"Date::DayOfWeek" => 0,
"DateTime" => 0,
"File::Spec" => 0,
"IO::Handle" => 0,
"IPC::Open3" => 0,
"Test::More" => 0,
"Time::DayOfWeek" => 0,
"Time::Moment" => 0,
"strict" => 0,
"warnings" => 0
);
Both Date::DayOfWeek and Time::DayOfWeek are lightweight modules.
Time::DayOfWeek
Author: PIP <https://metacpan.org/author/PIP>
Both Date::DayOfWeek and Time::DayOfWeek are lightweight modules.
This module offers cryptic and confusing function names: "DoW"
returns 0-6, "Dow" returns 3-letter abbrev.
DateTime
Author: DROLSKY <https://metacpan.org/author/DROLSKY>
Compared to Date::DayOfWeek and Time::DayOfWeek, DateTime is a
behemoth. But it provides a bunch of other functionalities as well.
Date::Calc
Author: STBEY <https://metacpan.org/author/STBEY>
Date::Calc is a nice compromise when you want something that is more
lightweight and does not need to be as accurate as DateTime.
Time::Moment
Author: CHANSEN <https://metacpan.org/author/CHANSEN>
Time::Moment is also a nice alternative to DateTime. Although it's
not as featureful as DateTime, it is significantly more lightweight.
Compared to Date::Calc, Time::Moment's API is closer to DateTime's.
Being an XS module, it's also faster.
BENCHMARKED MODULES
Version numbers shown below are the versions used when running the
sample benchmark.
Date::DayOfWeek 1.22
Time::DayOfWeek 1.8
DateTime 1.59
Date::Calc 6.4
Time::Moment 0.44
BENCHMARK PARTICIPANTS
* Date::DayOfWeek::dayofweek (perl_code)
Function call template:
Date::DayOfWeek::dayofweek(<day>, <month>, <year>)
* Time::DayOfWeek::DoW (perl_code)
Function call template:
Time::DayOfWeek::DoW(<year>, <month>, <day>)
* DateTime (perl_code)
Code template:
DateTime->new(year=><year>, month=><month>, day=><day>)->day_of_week
* Date::Calc::Day_of_Week (perl_code)
Function call template:
Date::Calc::Day_of_Week(<year>, <month>, <day>)
* Time::Moment (perl_code)
Code template:
% bencher --cpanmodules-module CalculatingDayOfWeek
Result formatted as table:
#table1#
{dataset=>"date1"}
+----------------------------+-----------+-----------+-----------------------+-----------------------+---------+---------+
| participant | rate (/s) | time (üs) | pct_faster_vs_slowest | pct_slower_vs_fastest | errors | samples |
+----------------------------+-----------+-----------+-----------------------+-----------------------+---------+---------+
| DateTime | 37000 | 27 | 0.00% | 8030.29% | 3.8e-08 | 24 |
| Date::DayOfWeek::dayofweek | 562000 | 1.78 | 1415.39% | 436.51% | 3.8e-10 | 20 |
| Date::Calc::Day_of_Week | 650000 | 1.54 | 1650.85% | 364.36% | 9.3e-10 | 20 |
| Time::DayOfWeek::DoW | 1030000 | 0.97 | 2677.36% | 192.73% | 6.3e-10 | 20 |
| Time::Moment | 3020000 | 0.331 | 8030.29% | 0.00% | 1.7e-10 | 20 |
+----------------------------+-----------+-----------+-----------------------+-----------------------+---------+---------+
The above result formatted in Benchmark.pm style:
Rate D DD:d DC:D_o_W TD:D T:M
D 37000/s -- -93% -94% -96% -98%
DD:d 562000/s 1416% -- -13% -45% -81%
DC:D_o_W 650000/s 1653% 15% -- -37% -78%
TD:D 1030000/s 2683% 83% 58% -- -65%
T:M 3020000/s 8057% 437% 365% 193% --
Legends:
D: participant=DateTime
DC:D_o_W: participant=Date::Calc::Day_of_Week
DD:d: participant=Date::DayOfWeek::dayofweek
T:M: participant=Time::Moment
TD:D: participant=Time::DayOfWeek::DoW
Sample benchmark #2
Benchmark command (benchmarking module startup overhead):
% bencher --cpanmodules-module CalculatingDayOfWeek --module-startup
Result formatted as table:
#table2#
+---------------------+-----------+-------------------+-----------------------+-----------------------+---------+---------+
| participant | time (ms) | mod_overhead_time | pct_faster_vs_slowest | pct_slower_vs_fastest | errors | samples |
+---------------------+-----------+-------------------+-----------------------+-----------------------+---------+---------+
| DateTime | 145 | 139.2 | 0.00% | 2398.83% | 3.7e-05 | 20 |
| Date::Calc | 24.9 | 19.1 | 483.22% | 328.45% | 1.2e-05 | 21 |
| Time::Moment | 12.2 | 6.4 | 1086.86% | 110.54% | 8.3e-06 | 20 |
| Time::DayOfWeek | 9.8 | 4 | 1380.99% | 68.73% | 5.7e-06 | 20 |
| Date::DayOfWeek | 9.34 | 3.54 | 1453.50% | 60.85% | 5e-06 | 20 |
| perl -e1 (baseline) | 5.8 | 0 | 2398.83% | 0.00% | 6.4e-06 | 20 |
+---------------------+-----------+-------------------+-----------------------+-----------------------+---------+---------+
The above result formatted in Benchmark.pm style:
Rate D D:C T:M T:D D:D perl -e1 (baseline)
D 6.9/s -- -82% -91% -93% -93% -96%
D:C 40.2/s 482% -- -51% -60% -62% -76%
T:M 82.0/s 1088% 104% -- -19% -23% -52%
T:D 102.0/s 1379% 154% 24% -- -4% -40%
D:D 107.1/s 1452% 166% 30% 4% -- -37%
perl -e1 (baseline) 172.4/s 2400% 329% 110% 68% 61% --
Legends:
D: mod_overhead_time=139.2 participant=DateTime
D:C: mod_overhead_time=19.1 participant=Date::Calc
D:D: mod_overhead_time=3.54 participant=Date::DayOfWeek
T:D: mod_overhead_time=4 participant=Time::DayOfWeek
T:M: mod_overhead_time=6.4 participant=Time::Moment
perl -e1 (baseline): mod_overhead_time=0 participant=perl -e1 (baseline)
To display as an interactive HTML table on a browser, you can add option
"--format html+datatables".
FAQ
lib/Acme/CPANModules/CalculatingDayOfWeek.pm view on Meta::CPAN
description => <<'_',
Both <pm:Date::DayOfWeek> and <pm:Time::DayOfWeek> are lightweight modules.
This module offers cryptic and confusing function names: `DoW` returns 0-6,
`Dow` returns 3-letter abbrev.
_
},
{
module => 'DateTime',
bench_code_template => 'DateTime->new(year=><year>, month=><month>, day=><day>)->day_of_week',
description => <<'_',
Compared to <pm:Date::DayOfWeek> and <pm:Time::DayOfWeek>, <pm:DateTime> is a
behemoth. But it provides a bunch of other functionalities as well.
_
},
{
module => 'Date::Calc',
bench_fcall_template => 'Date::Calc::Day_of_Week(<year>, <month>, <day>)',
description => <<'_',
<pm:Date::Calc> is a nice compromise when you want something that is more
lightweight and does not need to be as accurate as <pm:DateTime>.
_
},
{
module => 'Time::Moment',
bench_code_template => 'Time::Moment->new(year => <year>, month => <month>, day => <day>)->day_of_week',
description => <<'_',
<pm:Time::Moment> is also a nice alternative to <pm:DateTime>. Although it's not
as featureful as DateTime, it is significantly more lightweight. Compared to
<pm:Date::Calc>, Time::Moment's API is closer to DateTime's. Being an XS module,
it's also faster.
_
},
],
bench_datasets => [
{name=>'date1', args => {day=>20, month=>11, year=>2019}},
],
lib/Acme/CPANModules/CalculatingDayOfWeek.pm view on Meta::CPAN
=item L<Time::DayOfWeek>
Author: L<PIP|https://metacpan.org/author/PIP>
Both L<Date::DayOfWeek> and L<Time::DayOfWeek> are lightweight modules.
This module offers cryptic and confusing function names: C<DoW> returns 0-6,
C<Dow> returns 3-letter abbrev.
=item L<DateTime>
Author: L<DROLSKY|https://metacpan.org/author/DROLSKY>
Compared to L<Date::DayOfWeek> and L<Time::DayOfWeek>, L<DateTime> is a
behemoth. But it provides a bunch of other functionalities as well.
=item L<Date::Calc>
Author: L<STBEY|https://metacpan.org/author/STBEY>
L<Date::Calc> is a nice compromise when you want something that is more
lightweight and does not need to be as accurate as L<DateTime>.
=item L<Time::Moment>
Author: L<CHANSEN|https://metacpan.org/author/CHANSEN>
L<Time::Moment> is also a nice alternative to L<DateTime>. Although it's not
as featureful as DateTime, it is significantly more lightweight. Compared to
L<Date::Calc>, Time::Moment's API is closer to DateTime's. Being an XS module,
it's also faster.
=back
=head1 BENCHMARKED MODULES
Version numbers shown below are the versions used when running the sample benchmark.
L<Date::DayOfWeek> 1.22
L<Time::DayOfWeek> 1.8
L<DateTime> 1.59
L<Date::Calc> 6.4
L<Time::Moment> 0.44
=head1 BENCHMARK PARTICIPANTS
=over
=item * Date::DayOfWeek::dayofweek (perl_code)
lib/Acme/CPANModules/CalculatingDayOfWeek.pm view on Meta::CPAN
=item * Time::DayOfWeek::DoW (perl_code)
Function call template:
Time::DayOfWeek::DoW(<year>, <month>, <day>)
=item * DateTime (perl_code)
Code template:
DateTime->new(year=><year>, month=><month>, day=><day>)->day_of_week
=item * Date::Calc::Day_of_Week (perl_code)
Function call template:
Date::Calc::Day_of_Week(<year>, <month>, <day>)
lib/Acme/CPANModules/CalculatingDayOfWeek.pm view on Meta::CPAN
% bencher --cpanmodules-module CalculatingDayOfWeek
Result formatted as table:
#table1#
{dataset=>"date1"}
+----------------------------+-----------+-----------+-----------------------+-----------------------+---------+---------+
| participant | rate (/s) | time (μs) | pct_faster_vs_slowest | pct_slower_vs_fastest | errors | samples |
+----------------------------+-----------+-----------+-----------------------+-----------------------+---------+---------+
| DateTime | 37000 | 27 | 0.00% | 8030.29% | 3.8e-08 | 24 |
| Date::DayOfWeek::dayofweek | 562000 | 1.78 | 1415.39% | 436.51% | 3.8e-10 | 20 |
| Date::Calc::Day_of_Week | 650000 | 1.54 | 1650.85% | 364.36% | 9.3e-10 | 20 |
| Time::DayOfWeek::DoW | 1030000 | 0.97 | 2677.36% | 192.73% | 6.3e-10 | 20 |
| Time::Moment | 3020000 | 0.331 | 8030.29% | 0.00% | 1.7e-10 | 20 |
+----------------------------+-----------+-----------+-----------------------+-----------------------+---------+---------+
The above result formatted in L<Benchmark.pm|Benchmark> style:
Rate D DD:d DC:D_o_W TD:D T:M
D 37000/s -- -93% -94% -96% -98%
DD:d 562000/s 1416% -- -13% -45% -81%
DC:D_o_W 650000/s 1653% 15% -- -37% -78%
TD:D 1030000/s 2683% 83% 58% -- -65%
T:M 3020000/s 8057% 437% 365% 193% --
Legends:
D: participant=DateTime
DC:D_o_W: participant=Date::Calc::Day_of_Week
DD:d: participant=Date::DayOfWeek::dayofweek
T:M: participant=Time::Moment
TD:D: participant=Time::DayOfWeek::DoW
=head2 Sample benchmark #2
Benchmark command (benchmarking module startup overhead):
% bencher --cpanmodules-module CalculatingDayOfWeek --module-startup
Result formatted as table:
#table2#
+---------------------+-----------+-------------------+-----------------------+-----------------------+---------+---------+
| participant | time (ms) | mod_overhead_time | pct_faster_vs_slowest | pct_slower_vs_fastest | errors | samples |
+---------------------+-----------+-------------------+-----------------------+-----------------------+---------+---------+
| DateTime | 145 | 139.2 | 0.00% | 2398.83% | 3.7e-05 | 20 |
| Date::Calc | 24.9 | 19.1 | 483.22% | 328.45% | 1.2e-05 | 21 |
| Time::Moment | 12.2 | 6.4 | 1086.86% | 110.54% | 8.3e-06 | 20 |
| Time::DayOfWeek | 9.8 | 4 | 1380.99% | 68.73% | 5.7e-06 | 20 |
| Date::DayOfWeek | 9.34 | 3.54 | 1453.50% | 60.85% | 5e-06 | 20 |
| perl -e1 (baseline) | 5.8 | 0 | 2398.83% | 0.00% | 6.4e-06 | 20 |
+---------------------+-----------+-------------------+-----------------------+-----------------------+---------+---------+
The above result formatted in L<Benchmark.pm|Benchmark> style:
Rate D D:C T:M T:D D:D perl -e1 (baseline)
D 6.9/s -- -82% -91% -93% -93% -96%
D:C 40.2/s 482% -- -51% -60% -62% -76%
T:M 82.0/s 1088% 104% -- -19% -23% -52%
T:D 102.0/s 1379% 154% 24% -- -4% -40%
D:D 107.1/s 1452% 166% 30% 4% -- -37%
perl -e1 (baseline) 172.4/s 2400% 329% 110% 68% 61% --
Legends:
D: mod_overhead_time=139.2 participant=DateTime
D:C: mod_overhead_time=19.1 participant=Date::Calc
D:D: mod_overhead_time=3.54 participant=Date::DayOfWeek
T:D: mod_overhead_time=4 participant=Time::DayOfWeek
T:M: mod_overhead_time=6.4 participant=Time::Moment
perl -e1 (baseline): mod_overhead_time=0 participant=perl -e1 (baseline)
To display as an interactive HTML table on a browser, you can add option C<--format html+datatables>.
=head1 FAQ
lib/Acme/CPANModules_ScenarioR/CalculatingDayOfWeek.pm view on Meta::CPAN
## no critic
package Acme::CPANModules_ScenarioR::CalculatingDayOfWeek;
our $VERSION = 0.002; # VERSION
our $results = [[200,"OK",[{_name=>"participant=DateTime",_succinct_name=>"D",errors=>3.8e-08,participant=>"DateTime",pct_faster_vs_slowest=>0,pct_slower_vs_fastest=>80.570996978852,rate=>37000,samples=>24,time=>27},{_name=>"participant=Date::DayOfWe...
1;
# ABSTRACT: List of modules to calculate day of week
=head1 DESCRIPTION
This module is automatically generated by Pod::Weaver::Plugin::Bencher::Scenario during distribution build.
A Acme::CPANModules_ScenarioR::* module contains the raw result of sample benchmark and might be useful for some stuffs later.
( run in 0.421 second using v1.01-cache-2.11-cpan-05444aca049 )