Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor _decode_labels_at_offset to avoid recusion #1094

Closed
bdraco opened this issue Oct 11, 2022 · 9 comments · Fixed by #1111
Closed

Refactor _decode_labels_at_offset to avoid recusion #1094

bdraco opened this issue Oct 11, 2022 · 9 comments · Fixed by #1111

Comments

@bdraco
Copy link
Member

bdraco commented Oct 11, 2022

_decode_labels_at_offset is the most expensive function in terms of execution overhead in the whole stack

part of that is the python overhead of the recursion

@bdraco
Copy link
Member Author

bdraco commented Oct 17, 2022

decode_labels_at_offset

@bdraco
Copy link
Member Author

bdraco commented Oct 19, 2022

rpi3

RPI3

@bdraco
Copy link
Member Author

bdraco commented Oct 19, 2022

Its the python call overhead here that is the issue

@bdraco
Copy link
Member Author

bdraco commented Oct 20, 2022

refactoring didn't help much. This is just expensive unfortunately.

@bdraco bdraco closed this as completed Oct 20, 2022
@bdraco bdraco reopened this Oct 20, 2022
@bdraco
Copy link
Member Author

bdraco commented Oct 20, 2022

I really don't see how this can be made faster unless we make a cython extension. We could do pxd files so it would work with or without, but then we need to publish wheels

@bdraco
Copy link
Member Author

bdraco commented Oct 20, 2022

incoming parsing and _dns object creation even public would get a major boost if we did that

@bdraco
Copy link
Member Author

bdraco commented Oct 20, 2022

I couldn't get rid of the recursion but I did get a 36% speed up with #1097

@bdraco
Copy link
Member Author

bdraco commented Oct 20, 2022

less_recurse

The number of re-entries is significantly reduced after #1097

@bdraco
Copy link
Member Author

bdraco commented Oct 20, 2022

Any future improvements would likely need to be a C extension, but 35% improvement helps a bit.

The RPI3b is still a bit unstable at startup but any little bit helps

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant