[asterisk-dev] [Code Review] testsuite: speed up __make_directory_structure by caching processed dirs

wdoekes reviewboard at asterisk.org
Mon Mar 18 05:04:54 CDT 2013


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviewboard.asterisk.org/r/2396/
-----------------------------------------------------------

Review request for Asterisk Developers.


Summary
-------

The testsuite symlinks all files from asterisk.conf [directories] into its /tmp/* path for every test.

It does a os.walk() and os.path.exists() of /var/lib/asterisk contents 4 times by default, instead of only once. That's a bit unnecessary.

I added a dir-cache set() to keep track of copied base directories. Expect a negligible speed increase per test.


Diffs
-----

  /asterisk/trunk/lib/python/asterisk/asterisk.py 3668 

Diff: https://reviewboard.asterisk.org/r/2396/diff


Testing
-------

I tested 57 SIP tests on a lightly loaded system. They ran 300ms faster on average, 230ms median.


Thanks,

wdoekes

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20130318/3f42e650/attachment.htm>


More information about the asterisk-dev mailing list