diff options
author | Christian Heimes <cheimes@redhat.com> | 2017-02-14 13:19:19 +0100 |
---|---|---|
committer | Martin Basti <mbasti@redhat.com> | 2017-02-15 17:27:56 +0100 |
commit | 1d7fcfe15d279e50d9ac29464a30f8e594db1802 (patch) | |
tree | 660aab879c1302315c1598281240566bff5e8ffd | |
parent | 2ff07b958079e5a8972b2e7a06881521361746cc (diff) | |
download | freeipa-1d7fcfe15d279e50d9ac29464a30f8e594db1802.tar.gz freeipa-1d7fcfe15d279e50d9ac29464a30f8e594db1802.tar.xz freeipa-1d7fcfe15d279e50d9ac29464a30f8e594db1802.zip |
Explain more performance tricks in doc string
Signed-off-by: Christian Heimes <cheimes@redhat.com>
Reviewed-By: Martin Basti <mbasti@redhat.com>
Reviewed-By: Jan Cholasta <jcholast@redhat.com>
-rw-r--r-- | ipalib/rpc.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/ipalib/rpc.py b/ipalib/rpc.py index b4e5ecbc0..b91e8e24d 100644 --- a/ipalib/rpc.py +++ b/ipalib/rpc.py @@ -285,9 +285,12 @@ class _JSONPrimer(dict): * O(1) type look instead of O(n) chain of costly isinstance() calls * __missing__ and __mro__ with caching to handle subclasses - * inlined code with minor code duplication + * inline code with minor code duplication (func lookup in enc_list/dict) + * avoid surplus function calls (e.g. func is _identity, obj.__class__ + instead if type(obj)) * function default arguments to turn global into local lookups - * on-demand lookup of client capabilities with cache + * avoid re-creation of bound method objects (e.g. result.append) + * on-demand lookup of client capabilities with cached values Depending on the client version number, the primer converts: |