Closed GoogleCodeExporter closed 8 years ago
Note that where patch is used a great deal:
Construction times (instantiating 1000 times)
Mock: old 0.038074016571
MagicMock: new 0.484632015228
MagicMock is about 15 times slower than Mock for instantiation.
Original comment by fuzzyman
on 28 Oct 2011 at 11:37
After some work, instantiating a MagicMock is now only 5 times slower than
instantiating a Mock *used* to be in 0.7.2. Both Mock and MagicMock
instantiation could still be improved (why is instantiating a Mock twice as
slow as it used to be for example).
Original comment by fuzzyman
on 29 Oct 2011 at 10:03
Some more benchmarks:
http://paste.pound-python.org/show/15076/
http://paste.pound-python.org/show/15078/
Much more time is spent in __call__ and also in __setattr__
The move to 0.8 *adds* a lot of calls to __setattr__
Original comment by fuzzyman
on 22 Nov 2011 at 12:38
With current head:
http://paste.pound-python.org/show/15086/
Back down ~10% to around a 60% slowdown.
Original comment by jul...@grayvines.com
on 22 Nov 2011 at 7:02
Closing this issue as I consider mock performance to be "acceptable". If there
are further performance issues please open a new issue.
Original comment by fuzzyman
on 14 Mar 2012 at 6:18
Original issue reported on code.google.com by
fuzzyman
on 28 Oct 2011 at 11:36Attachments: