python-iptables
python-iptables copied to clipboard
Speed up code for arm architecture when creating new rules
Since the arm architecture is slow to always lookup the tables, the creation of many rules with standard targets like Accept or Reject can slow down the creation of firewall rules. For this reason, a dictionary is used to check available tables and standard targets are not check if they are a chain. This code can halve the execution time on an Arm architectures if many firewall rules are created.
Since the arm architecture is slow to always lookup the tables, the creation of many rules with standard targets like Accept or Reject can slow down the creation of firewall rules. For this reason, a dictionary is used to check available tables and standard targets are not check if they are a chain. This code can halve the execution time on an Arm architectures if many firewall rules are created.
Sorry, this escaped my attention. If you still would like to merge it, please rebase it on current master and I'm happy to take a look.
I updated the branch with a rebase. Can you have a look at it?
I updated the branch with a rebase. Can you have a look at it?
I think this is a great idea if this gives a speed bump.
That being said, I'd much rather implement this caching via something like a static class field instead of a global variable. Any chance you can refactor this?
Thanks for your hint. In my new commit, I moved the variable to a static class variable.
@ldx What has to be changed to merge this improvement?
@jkklemm merged, thank you for your patience!