On Mon, Jun 01, 2015 at 12:30:04AM -0700, Andy Zhou wrote:
> Although multiple jsonrpc monitors can share the same ovsdb monitor,
> each change still needs to translated into json object from scratch.
> This can be wasteful if multiple jsonrpc monitors are interested in the
> same changes.
> 
> Json cache improves this by keeping an copy of json object generated
> for transaction X to current transaction. When jsonrpc is interested
> in a change, the cache is searched first, if an json object is found,
> a copy of it is handed back, skipping the regeneration process.
> 
> Any commit to the monitor will empty the cache. This can be further
> optimized to not throw away the cache if the updated tables and columns
> are not being monitored.
> 
> Signed-off-by: Andy Zhou <az...@nicira.com>
> Acked-by: Ben Pfaff <b...@nicira.com>
> 
> ---
> v1->v2: Each monitor now has its own json cache. Remove the global
>         json cache.
>         Some refatoring to make to code easier to follow.
> 
> v2->v3: Destroy json_cache hmap on monitor destroy. Without it,
>         valgrind reports memory leak.
> 
> v3->v4: style fixes

In ovsdb_monitor_json_cache_flush(), the 'if' check for NULL isn't
needed because json_destroy() is a no-op for null pointers.

Acked-by: Ben Pfaff <b...@nicira.com>
_______________________________________________
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev

Reply via email to