-
-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
'evalSha' is deprecated #49
Comments
@umbri What's the logic you implemented? I guess you can just use It does implement the API, just not totally low-level. |
@kelunik I understand that this is a feature, but for me I need that old evalSha(), as I say I have some old code that was ported from another language with a lot of tests and using old evalSha() all was fine, now I get error, I understand that I can rewrite it but I think there may be other one as me, I suggest to just mark it as |
If you don't want to get deprecation warnings, you can exclude them in your error reporting setting or explicitly silence your call to We could maybe talk about not deprecating it at all, but given that it newer worked correctly, I don't see a lot of advantage in that. |
I am worry of this extra call for I am calling |
We could optimize that and include a lookup cache. <?php
$cache = [];
function bench(string $script) {
global $cache;
// version without cache: return \sha1($script);
if (isset($cache[$script])) {
return $cache[$script];
}
$sha1 = \sha1($script);
$cache[$script] = $sha1;
return $sha1;
}
$start = \microtime(true);
for ($i = 0; $i < 1000000; $i++) {
bench("foobar = foobar = foobar = foobar = foobar;");
}
var_dump(\microtime(true) - $start);
|
Closing, as https://github.com/amphp/redis/releases/tag/v0.3.3 has been released with a script cache. |
@kelunik I think that 763f30a is not in place, I think that a redis client must implement API and not decide what is better, I have some old tested logic that works perfect, but after that commit it fail, my opinion is to use
@deprecated
?The text was updated successfully, but these errors were encountered: