MartijnBraam / python-isc-dhcp-leases

Small python module for reading /var/lib/dhcp/dhcpd.leases from isc-dhcp-server
MIT License
123 stars 47 forks source link

Improved performance and rewritten property parsing #13

Closed andir closed 8 years ago

andir commented 8 years ago

Since I'm running this code several times a second with a larger lease database I've been trying to improve the parsing speed of this library. With these changes we've seen a 40% improvement in our application. It is a brutal approach compared to the regex solution it was before but the code should be clean and readable enough to not be an issue.

coveralls commented 8 years ago

Coverage Status

Coverage remained the same at 100.0% when pulling 30a0931d4b0e1e0e86108bccadafafc897f16d6d on andir:fix-performance into 3be65023daf8ffb18468dfe8e5619ce7ecd2dbc0 on MartijnBraam:master.

MartijnBraam commented 8 years ago

Well this is quite a changeset. I've fixed a typo in d675888e317419db025117b937f955f89ba5b12f and removed some mutable default parameters in 7375450bc27531e6b08a515be8c58f65832f2076

Using less regex magic should make this more maintainable, especially when adding edge cases for almost-compatible files

andir commented 8 years ago

Cool, Thank you once again :+1: