jhthorsen / mojo-redis

Non-blocking Redis driver using Mojo::IOLoop
https://metacpan.org/pod/Mojo::Redis
14 stars 11 forks source link

Use Protocol::Redis::XS 0.06 or higher #43

Closed Grinnz closed 5 years ago

Grinnz commented 5 years ago

This is effectively a revert of https://github.com/jhthorsen/mojo-redis/commit/8c73f4b5bc75a8d03306c89890b9389e340775a0 to restore use of Protocol::Redis::XS if it's at least version 0.06, where the known issues have been resolved.

jhthorsen commented 5 years ago

LGTM 👍

jhthorsen commented 5 years ago

I was unable to install Protocol::Redis::XS though. Here is the complete log: https://p.thorsen.pm/32db0eccdb5b

It seems like it does rm -f blib/arch/auto/Protocol/Redis/XS/XS.bundle on line 646. Is that strange..?

Grinnz commented 5 years ago

I believe that's because it's regenerating that file. I don't know about the MacOS build system but maybe someone else knows what's going on.

Grinnz commented 5 years ago

Could you open an issue for Protocol::Redis::XS, and if you want to, submit a cpantesters report?

Grinnz commented 5 years ago

One thing I would try is to cpanm --uninstall Alien::hiredis, and install it again cleanly - there was a change in 0.006 which is unfortunately not effective if a previous version was installed (hopefully this will be a rare case...)

jhthorsen commented 5 years ago

Sorry for the late reply 😞 It worked after uninstalling first 👍

$ cpanm --uninstall Alien::hiredis

$ cpanm Protocol::Redis::XS
...
Successfully installed Protocol-Redis-XS-0.06 (upgraded from 0.05)
2 distributions installed

$ TEST_BENCHMARK=1000 TEST_ONLINE=redis://localhost/8 prove -vl t/benchmark.t
t/benchmark.t ..
ok 1 - Mojo::Redis/Protocol::Redis 6.07145 wallclock secs ( 5.86 usr +  0.08 sys =  5.94 CPU) @ 168.35/s (n=1000)
ok 2 - Mojo::Redis/Protocol::Redis::Faster 2.95427 wallclock secs ( 2.77 usr +  0.06 sys =  2.83 CPU) @ 353.36/s (n=1000)
ok 3 - Mojo::Redis/Protocol::Redis::XS 1.96365 wallclock secs ( 1.79 usr +  0.06 sys =  1.85 CPU) @ 540.54/s (n=1000)
ok 4 - Mojo::Redis2/Protocol::Redis 7.39298 wallclock secs ( 7.16 usr +  0.08 sys =  7.24 CPU) @ 138.12/s (n=1000)
ok 5 - Mojo::Redis2/Protocol::Redis::Faster 4.51007 wallclock secs ( 4.24 usr +  0.07 sys =  4.31 CPU) @ 232.02/s (n=1000)
ok 6 - Mojo::Redis2/Protocol::Redis::XS 3.23473 wallclock secs ( 3.05 usr +  0.06 sys =  3.11 CPU) @ 321.54/s (n=1000)
ok 7 - Redis/Faster (2.83s) is not slower than Redis2/Faster (4.31s)
ok 8 - Redis/Faster (2.83s) is not slower than Redis/PP (5.94s)
               Rate Redis2/PP Redis/PP Redis2/Faster Redis2/XS Redis/Faster Redis/XS
Redis2/PP     138/s        --     -18%          -40%      -57%         -61%     -74%
Redis/PP      168/s       22%       --          -27%      -48%         -52%     -69%
Redis2/Faster 232/s       68%      38%            --      -28%         -34%     -57%
Redis2/XS     322/s      133%      91%           39%        --          -9%     -41%
Redis/Faster  353/s      156%     110%           52%       10%           --     -35%
Redis/XS      541/s      291%     221%          133%       68%          53%       --
1..8
ok
All tests successful.
Files=1, Tests=8, 27 wallclock secs ( 0.02 usr  0.00 sys + 25.24 cusr  0.45 csys = 25.71 CPU)
Result: PASS
Grinnz commented 5 years ago

The feature being developed in https://github.com/Perl5-Alien/Alien-Build/pull/114 should hopefully alleviate the clean install requirement in the future.