-
Notifications
You must be signed in to change notification settings - Fork 1
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
caching optimization ... #3
Comments
Thank you for looking into the code, Linas. About the suggestion to add caching, wouldn't it better to use |
The keybase is per-atom. You can use the same key for all atoms.
Well, part of the point is that you can pre-query 1001 typical, common queries, and then any client who does one of these typical common queries gets an instant answer. And if you pre-query 1001 typical, common queries, and save them in rocksdb, then next time you reboot the server, you don't even have to pre-mine again,. They are still there. |
I see. In that case I will make the change you suggested |
Thank you! |
From the example you gave above, the key is a handle instead of a string. So I should instantiate a handle from the input key string before using it to get previous values. But what is the type of this key handle(Atom)? I see in this example the type of the key is a |
The keys must always be Atoms. They can be any Atom, but if you just want something simple e.g. "a string", then use |
If you do use something simple, and you use the same key everywhere, then the naming convention is to surround it with asterisk-dashes: e.g |
If you want to use |
I may sound like a broken record, but .... I think there are a few small things you can do o improve performance, via caching...
So, here:
atomspace-rpc/src/manager/AtomSpaceManager.cpp
Line 67 in c49b994
change to
(const std::string &id, const std::string &pattern, const std::string &key)
and here:
atomspace-rpc/src/manager/AtomSpaceManager.cpp
Lines 86 to 93 in c49b994
change to
The search is done only once; after that, the previous cached value is returned "instantlly".
I'm recommending this API because its "compatible" with the previously-mentioned
cog-execute-cached!
API. (which BTW is not etched in stone, yet, its still an experimental API)The text was updated successfully, but these errors were encountered: