Bug 48888 - Review request: zeitgeist event caching
Summary: Review request: zeitgeist event caching
Status: RESOLVED MOVED
Alias: None
Product: Zeitgeist
Classification: Unclassified
Component: Engine (show other bugs)
Version: unspecified
Hardware: Other All
: medium normal
Assignee: zeitgeist-bugs@lists.freedesktop.org
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-04-18 11:46 UTC by Trever Fischer
Modified: 2018-05-31 09:11 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments
event cache patch (8.86 KB, patch)
2012-04-18 11:46 UTC, Trever Fischer
Details | Splinter Review

Description Trever Fischer 2012-04-18 11:46:24 UTC
Created attachment 60268 [details] [review]
event cache patch

This adds event caching to the zeitgeist engine, which speeds up query performance.

Also available in git: http://cgit.freedesktop.org/zeitgeist/zeitgeist/log/?h=tdfischer/event-caching
Comment 1 Seif Lotfy 2012-04-18 18:14:10 UTC
looks good to me. Anybody else want to comment on this?
Comment 2 Seif Lotfy 2012-04-19 13:02:47 UTC
Comment on attachment 60268 [details] [review]
event cache patch

Review of attachment 60268 [details] [review]:
-----------------------------------------------------------------

::: test/direct/event-cache-test.vala
@@ +15,5 @@
> + *
> + * You should have received a copy of the GNU Lesser General Public License
> + * along with this program.  If not, see <http://www.gnu.org/licenses/>.
> + *
> + */

Nice copyrights :D

@@ +31,5 @@
> +    Test.add_func("/EventCache/expiration", expiration_test);
> +
> +    return Test.run ();
> +}
> +

You better test
Comment 3 Siegfried-Angel Gevatter Pujals 2012-06-12 09:08:04 UTC
[This was first reviewed at https://code.launchpad.net/~tdfischer/zeitgeist/event-caching/+merge/97450]
Comment 4 Siegfried-Angel Gevatter Pujals 2012-06-12 09:22:44 UTC
Comment on attachment 60268 [details] [review]
event cache patch

Review of attachment 60268 [details] [review]:
-----------------------------------------------------------------

Here's some more comments... Also, can you please include the links to the benchmarks you had, for future reference?

IIRC I asked for some additional benchmark (for when stuff isn't in the cache, or something like that), did you get around to trying that?

Thanks!

::: src/db-reader.vala
@@ +180,5 @@
>          {
> +            Event e = events.lookup (id);
> +            if (e != null)
> +                cache.cache_event (e);
> +            results.set(i++, e);

When retrieving events from cache you've put them directly into "results" (not "events"), so aren't you overwritting them with null here?

::: src/event-cache.vala
@@ +40,5 @@
> +    {
> +        Event? e = cache_table.get (id);
> +        if (e != null)
> +        {
> +            lru_queue.remove_all (id);

Wouldn't remove() be faster? (There shouldn't be repeated IDs in the queue)
Comment 5 Seif Lotfy 2012-08-20 21:58:50 UTC
(In reply to comment #4)
> Comment on attachment 60268 [details] [review] [review]
> event cache patch
> 
> Review of attachment 60268 [details] [review] [review]:
> -----------------------------------------------------------------
> 
> Here's some more comments... Also, can you please include the links to the
> benchmarks you had, for future reference?
> 
> IIRC I asked for some additional benchmark (for when stuff isn't in the cache,
> or something like that), did you get around to trying that?
> 
> Thanks!
> 

IIRC I think we had benchmarked the python implementation making it faster if the maximum elements in cache is not queried and else we skip the cache. So pretty sure it was faster for queries with elements results < maximum cache size...

> ::: src/db-reader.vala
> @@ +180,5 @@
> >          {
> > +            Event e = events.lookup (id);
> > +            if (e != null)
> > +                cache.cache_event (e);
> > +            results.set(i++, e);
> 
> When retrieving events from cache you've put them directly into "results" (not
> "events"), so aren't you overwritting them with null here?

Good question.

> 
> ::: src/event-cache.vala
> @@ +40,5 @@
> > +    {
> > +        Event? e = cache_table.get (id);
> > +        if (e != null)
> > +        {
> > +            lru_queue.remove_all (id);
> 
> Wouldn't remove() be faster? (There shouldn't be repeated IDs in the queue)

Good point...
Trever can you have one last look so i can merge this soon?
Cheers
Seif
Comment 6 GitLab Migration User 2018-05-31 09:11:58 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/zeitgeist/zeitgeist/issues/1.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.