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

add an example of marshalling using reflect #202

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

Baron-Rouge
Copy link

@Baron-Rouge Baron-Rouge commented Feb 22, 2022

add MarshalTo() and MarshalLen() for GTPv2 echo request using reflect package

reflection can be used in order to define Marshal functions once for all. here is an example with GTPv2 echo request message. Message interface may be used to apply this to all messages types.

add MarshalTo() and MarshalLen() for GTPv2 echo request using reflect package
@wmnsk
Copy link
Owner

wmnsk commented Mar 29, 2022

I'm generally not in favor of using reflection in the packet processing, as there may be a concern in performance. Could you add some benchmarks to show the difference?

@Baron-Rouge
Copy link
Author

I just added benchmarks for GTPv2 echo request and create session request. Marshalling using reflect is two to four times slowler than current Marshalling.

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 this pull request may close these issues.

None yet

2 participants