diff options
| author | Ben Pfaff <blp@nicira.com> | 2013-03-05 15:30:33 -0800 |
|---|---|---|
| committer | Ben Pfaff <blp@nicira.com> | 2013-03-05 21:35:41 -0800 |
| commit | fe19569ac50a7d398e0e44a00fd22b323748de06 (patch) | |
| tree | c1bc34f5df7496c4932c697e6629c8434d33183d /python | |
| parent | c9e5dfbd18dc6ba826a6e5751507040284ed45da (diff) | |
| download | openvswitch-fe19569ac50a7d398e0e44a00fd22b323748de06.tar.gz | |
ovsdb-idlc: Make no-op writes to write-only columns cheaper.
For 1000 tunnels with CFM enabled, this reduces CPU use from
about 36% to about 30%.
Bug #15171.
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
Diffstat (limited to 'python')
| -rw-r--r-- | python/ovs/db/types.py | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/python/ovs/db/types.py b/python/ovs/db/types.py index bd1c259cb..c858471b8 100644 --- a/python/ovs/db/types.py +++ b/python/ovs/db/types.py @@ -1,4 +1,4 @@ -# Copyright (c) 2009, 2010, 2011, 2012 Nicira, Inc. +# Copyright (c) 2009, 2010, 2011, 2012, 2013 Nicira, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -353,6 +353,15 @@ class BaseType(object): else: return "%(dst)s = %(src)s;" % args + def assign_c_value_casting_away_const(self, dst, src): + args = {'dst': dst, 'src': src} + if self.ref_table_name: + return ("%(dst)s = %(src)s->header_.uuid;") % args + elif self.type == StringType: + return "%(dst)s = CONST_CAST(char *, %(src)s);" % args + else: + return "%(dst)s = %(src)s;" % args + def initCDefault(self, var, is_optional): if self.ref_table_name: return "%s = NULL;" % var |
