Acme-CPANModules-Import-CPANRatings-User-stevenharyanto
view release on metacpan or search on metacpan
$ds=Data::Seek->new(data=>$data);
$ds->search("j.1.\@")->data },
<br><br>dpath=>sub{ dpath("/j/1/*")->match($data) },
<br><br>jpath=>sub{
JSON::Path->new(q[$.j.1.[*]])->values($data) }, <br> }); <br>
=head2 #
<br><br>### <br> Benchmark: running dpath, dseek, dseek_cacheobj,
jpath for at least 0.25 CPU seconds... <br><br>dpath: 1 wallclock
secs ( 0.27 usr + 0.00 sys = 0.27 CPU) @ 8292.59/s (n=2239)
<br><br>(warning: too few iterations for a reliable count)
<br><br>dseek: 1 wallclock secs ( 0.29 usr + 0.00 sys = 0.29 CPU) @
37.93/s (n=11) <br><br>(warning: too few iterations for a reliable
count) <br> dseek_cacheobj: 0 wallclock secs ( 0.33 usr + 0.00 sys =
0.33 CPU) @ 42.42/s (n=14) <br><br>(warning: too few iterations for
a reliable count) <br><br>jpath: 0 wallclock secs ( 0.27 usr + 0.00
sys = 0.27 CPU) @ 11711.11/s (n=3162) <br><br>(warning: too few
iterations for a reliable count) <br> =head2 #
<br><br>Also: 1) the syntax is rather inconsistent: ':n' for array
index access, but '.@' (instead of ':@') for grabbing all elements.
2) currently cannot select subtree (must always select leaf node).
<br><br>As alternatives, I recommend the much simpler JSON::Path, or
the more powerful Data::DPath. <br>
Games::2048
Author: BLAIZER <https://metacpan.org/author/BLAIZER>
devdata/stevenharyanto view on Meta::CPAN
<blockquote class="review_text">
The "extremely fast and efficient" claim currently doesn't hold, as this module creates a *whole* flattened tree for *every* search operation.
<br><br>A simple benchmark:
<br><br>###
<br>
use Benchmark qw(timethese);
<br>
use Data::Seek;
<br>
use Data::DPath qw(dpath);
<br>
use JSON::Path;
<br><br>my $data = { map { $_ => {map {$_=>[1..4]} 1..20} } "a".."z" };
<br><br>timethese(-0.25, {
<br><br>dseek => sub { $ds = Data::Seek->new(data=>$data); $ds->search("j.1.\@")->da...
});
<br>
###
<br><br>###
<br>
Benchmark: running dpath, dseek, dseek_cacheobj, jpath for at least 0.25 CPU seconds...
<br><br>dpath: 1 wallclock secs ( 0.27 usr + 0.00 sys = 0.27 CPU) @ 8292.59/s (n=2239)
<br><br>(warning: too few iterations for a reliable count)
<br><br>dseek...
dseek_cacheobj: 0 wallclock secs ( 0.33 usr + 0.00 sys = 0.33 CPU) @ 42.42/s (n=14)
<br><br>(warning: too few iterations for a reliable count)
<br><br>jpath: 0 wallclock secs ( 0.27 usr + 0.00 sys = 0.27 CPU) @ 11711.11/s (n=3162)
<br><br>(warn...
###
<br><br>Also: 1) the syntax is rather inconsistent: ':n' for array index access, but '.@' (instead of ':@') for grabbing all elements. 2) currently cannot select subtree (must always select leaf node).
<br><br>As alternatives, I recommend the muc...
</blockquote>
<div class="review_footer">
<p class="review_attribution">
<a href="/user/stevenharyanto">Steven Haryanto</a> - 2014-08-10T04:37:01
(<a href="/dist/Data-Seek#11870">permalink</a>)
</p>
lib/Acme/CPANModules/Import/CPANRatings/User/stevenharyanto.pm view on Meta::CPAN
package Acme::CPANModules::Import::CPANRatings::User::stevenharyanto;
use strict;
our $AUTHORITY = 'cpan:PERLANCAR'; # AUTHORITY
our $DATE = '2023-10-29'; # DATE
our $DIST = 'Acme-CPANModules-Import-CPANRatings-User-stevenharyanto'; # DIST
our $VERSION = '0.002'; # VERSION
our $LIST = {description=>"This list is generated by scraping CPANRatings (cpanratings.perl.org) user page.",entries=>[{description=>"\n(REMOVED)\n",module=>"Log::Any",rating=>undef},{description=>"\nProvides a thin/lightweight OO interface for \$?, ...
1;
# ABSTRACT: List of modules mentioned by CPANRatings user stevenharyanto
__END__
=pod
=encoding UTF-8
lib/Acme/CPANModules/Import/CPANRatings/User/stevenharyanto.pm view on Meta::CPAN
<br><br>jpath=>sub{ JSON::Path->new(q[$.j.1.[ >>]])->values($data) },
<br>
});
<br>
=head2 #
<br><br>###
<br>
Benchmark: running dpath, dseek, dseek_cacheobj, jpath for at least 0.25 CPU seconds...
<br><br>dpath: 1 wallclock secs ( 0.27 usr + 0.00 sys = 0.27 CPU) @ 8292.59/s (n=2239)
<br><br>(warning: too few iterations for a reliable count)
<br><br>dseek: 1 wallclock secs ( 0.29 usr + 0.00 sys = 0.29 CPU) @ 37.93/s (n=11)
<br><br>(warning: too few iterations for a reliable count)
<br>
dseek_cacheobj: 0 wallclock secs ( 0.33 usr + 0.00 sys = 0.33 CPU) @ 42.42/s (n=14)
<br><br>(warning: too few iterations for a reliable count)
<br><br>jpath: 0 wallclock secs ( 0.27 usr + 0.00 sys = 0.27 CPU) @ 11711.11/s (n=3162)
<br><br>(warning: too few iterations for a reliable count)
<br>
=head2 #
<br><br>Also: 1) the syntax is rather inconsistent: ':n' for array index access, but '.@' (instead of ':@') for grabbing all elements. 2) currently cannot select subtree (must always select leaf node).
<br><br>As alternatives, I recommend the much simpler JSON::Path, or the more powerful Data::DPath.
<br>
=item L<Games::2048>
( run in 1.195 second using v1.01-cache-2.11-cpan-96521ef73a4 )