Nir Soffer has posted comments on this change.

Change subject: WIP benchmark decorator module speed
......................................................................


Patch Set 2:

(2 comments)

Looks good, decorator module is 30 times slower, but the cost per call is only 
about 60 microseconds, worth the cleanup in the code.

https://gerrit.ovirt.org/#/c/63833/2/tests/api_test.py
File tests/api_test.py:

Line 60: def foobar(x, y, z):
Line 61:     pass
Line 62: """
Line 63:         print("decorator method speed penalty:")
Line 64:         print("with just functools.wraps: %s" % (
This would be more useful:

    %.6f
Line 65:             timeit.timeit(bench, setup=baseline, number=1000)
Line 66:         ))
Line 67:         print("with the decorator module: %s" % (
Line 68:             timeit.timeit(bench, setup=preserving, number=1000)


Line 61:     pass
Line 62: """
Line 63:         print("decorator method speed penalty:")
Line 64:         print("with just functools.wraps: %s" % (
Line 65:             timeit.timeit(bench, setup=baseline, number=1000)
And calculating time per call:

     (timeit.timeit(..., number=number) / number)
Line 66:         ))
Line 67:         print("with the decorator module: %s" % (
Line 68:             timeit.timeit(bench, setup=preserving, number=1000)
Line 69:         ))


-- 
To view, visit https://gerrit.ovirt.org/63833
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Id619702a42a37150fb6772790430f70a259ab2b6
Gerrit-PatchSet: 2
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Francesco Romani <from...@redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Nir Soffer <nsof...@redhat.com>
Gerrit-Reviewer: gerrit-hooks <automat...@ovirt.org>
Gerrit-HasComments: Yes
_______________________________________________
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/admin/lists/vdsm-patches@lists.fedorahosted.org

Reply via email to