You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@kvrocks.apache.org by GitBox <gi...@apache.org> on 2022/07/03 09:28:13 UTC

[GitHub] [incubator-kvrocks] mapleFU opened a new issue, #708: Enhancement: trying to reduce calling to `GetCurrentTime()` when not neccessary

mapleFU opened a new issue, #708:
URL: https://github.com/apache/incubator-kvrocks/issues/708

   ### Search before asking
   
   - [X] I had searched in the [issues](https://github.com/apache/incubator-kvrocks/issues) and found no similar issues.
   
   
   ### Motivation
   
   `Metadata::TTL()` and `Metadata::Expired()` will call `rocksdb::Env::Default()->GetCurrentTime(&now)` every time we called it. rocksdb's `GetCurrentTime` will ask time on OS, and mostly it will be a vdso call and may take about 10ns to get the current time.
   
   But sometimes we don't need to call it here. If `expire == 0`, just return without `GetCurrentTime` is ok.
   
   By the way, I'm confused that when would `expire` less than 0? Can some one helps me find out why?
   
   ### Solution
   
   remove `GetCurrentTime` when not neccessary.
   
   ### Are you willing to submit a PR?
   
   - [ ] I'm willing to submit a PR!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@kvrocks.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-kvrocks] PragmaTwice closed issue #708: Enhancement: trying to reduce calling to `GetCurrentTime()` when not neccessary

Posted by GitBox <gi...@apache.org>.
PragmaTwice closed issue #708: Enhancement: trying to reduce calling to `GetCurrentTime()` when not neccessary
URL: https://github.com/apache/incubator-kvrocks/issues/708


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@kvrocks.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-kvrocks] PragmaTwice commented on issue #708: Enhancement: trying to reduce calling to `GetCurrentTime()` when not neccessary

Posted by GitBox <gi...@apache.org>.
PragmaTwice commented on issue #708:
URL: https://github.com/apache/incubator-kvrocks/issues/708#issuecomment-1174777566

   Solved in #709.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@kvrocks.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-kvrocks] git-hulk commented on issue #708: Enhancement: trying to reduce calling to `GetCurrentTime()` when not neccessary

Posted by GitBox <gi...@apache.org>.
git-hulk commented on issue #708:
URL: https://github.com/apache/incubator-kvrocks/issues/708#issuecomment-1173047119

   @mapleFU `expire` should be never less than 0, so it's good to reduce the `GetCurrentTime` function call when expire is zero.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@kvrocks.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org