Acme-CPANModules-CalculatingDayOfWeek
view release on metacpan or search on metacpan
lib/Acme/CPANModules/CalculatingDayOfWeek.pm view on Meta::CPAN
use 5.010001;
use strict;
use warnings;
our $AUTHORITY = 'cpan:PERLANCAR'; # AUTHORITY
our $DATE = '2023-08-06'; # DATE
our $DIST = 'Acme-CPANModules-CalculatingDayOfWeek'; # DIST
our $VERSION = '0.002'; # VERSION
our $LIST = {
summary => 'List of modules to calculate day of week',
entries => [
{
module => 'Date::DayOfWeek',
bench_fcall_template => 'Date::DayOfWeek::dayofweek(<day>, <month>, <year>)',
description => <<'_',
Both <pm:Date::DayOfWeek> and <pm:Time::DayOfWeek> are lightweight modules.
_
},
{
module => 'Time::DayOfWeek',
bench_fcall_template => 'Time::DayOfWeek::DoW(<year>, <month>, <day>)',
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}},
],
};
1;
# ABSTRACT: List of modules to calculate day of week
__END__
=pod
=encoding UTF-8
=head1 NAME
Acme::CPANModules::CalculatingDayOfWeek - List of modules to calculate day of week
=head1 VERSION
This document describes version 0.002 of Acme::CPANModules::CalculatingDayOfWeek (from Perl distribution Acme-CPANModules-CalculatingDayOfWeek), released on 2023-08-06.
=head1 SYNOPSIS
To run benchmark with default option:
% bencher --cpanmodules-module CalculatingDayOfWeek
To run module startup overhead benchmark:
% bencher --module-startup --cpanmodules-module CalculatingDayOfWeek
For more options (dump scenario, list/include/exclude/add participants, list/include/exclude/add datasets, etc), see L<bencher> or run C<bencher --help>.
=head1 ACME::CPANMODULES ENTRIES
=over
=item L<Date::DayOfWeek>
Author: L<RBOW|https://metacpan.org/author/RBOW>
Both L<Date::DayOfWeek> and L<Time::DayOfWeek> are lightweight modules.
=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)
Function call template:
Date::DayOfWeek::dayofweek(<day>, <month>, <year>)
=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>)
=item * Time::Moment (perl_code)
Code template:
lib/Acme/CPANModules/CalculatingDayOfWeek.pm view on Meta::CPAN
% perl -MAcme::CPANModules::CalculatingDayOfWeek -E'say $_->{module} for @{ $Acme::CPANModules::CalculatingDayOfWeek::LIST->{entries} }' | cpanm -n
This Acme::CPANModules module contains benchmark instructions. You can run a
benchmark for some/all the modules listed in this Acme::CPANModules module using
the L<bencher> CLI (from L<Bencher> distribution):
% bencher --cpanmodules-module CalculatingDayOfWeek
This Acme::CPANModules module also helps L<lcpan> produce a more meaningful
result for C<lcpan related-mods> command when it comes to finding related
modules for the modules listed in this Acme::CPANModules module.
See L<App::lcpan::Cmd::related_mods> for more details on how "related modules"
are found.
=head1 HOMEPAGE
Please visit the project's homepage at L<https://metacpan.org/release/Acme-CPANModules-CalculatingDayOfWeek>.
=head1 SOURCE
Source repository is at L<https://github.com/perlancar/perl-Acme-CPANModules-CalculatingDayOfWeek>.
=head1 SEE ALSO
L<Acme::CPANModules> - about the Acme::CPANModules namespace
L<cpanmodules> - CLI tool to let you browse/view the lists
=head1 AUTHOR
perlancar <perlancar@cpan.org>
=head1 CONTRIBUTING
To contribute, you can send patches by email/via RT, or send pull requests on
GitHub.
Most of the time, you don't need to build the distribution yourself. You can
simply modify the code, then test via:
% prove -l
If you want to build the distribution (e.g. to try to install it locally on your
system), you can install L<Dist::Zilla>,
L<Dist::Zilla::PluginBundle::Author::PERLANCAR>,
L<Pod::Weaver::PluginBundle::Author::PERLANCAR>, and sometimes one or two other
Dist::Zilla- and/or Pod::Weaver plugins. Any additional steps required beyond
that are considered a bug and can be reported to me.
=head1 COPYRIGHT AND LICENSE
This software is copyright (c) 2023 by perlancar <perlancar@cpan.org>.
This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.
=head1 BUGS
Please report any bugs or feature requests on the bugtracker website L<https://rt.cpan.org/Public/Dist/Display.html?Name=Acme-CPANModules-CalculatingDayOfWeek>
When submitting a bug or request, please include a test-file or a
patch to an existing test-file that illustrates the bug or desired
feature.
=cut
( run in 0.442 second using v1.01-cache-2.11-cpan-39bf76dae61 )