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

Lazy header parsing #21

Closed
emiago opened this issue May 1, 2023 · 0 comments
Closed

Lazy header parsing #21

emiago opened this issue May 1, 2023 · 0 comments
Labels
enhancement New feature or request in progress

Comments

@emiago
Copy link
Owner

emiago commented May 1, 2023

To gain more performance we could implement lazy parsing within sip headers.
Currently we have some default parsing which could be reduced
https://github.com/emiago/sipgo/blob/main/parser/parse_header.go#L18

Currently lazy parsing can only be done for rest of headers as they are only stored as key:value
Some of parser optimized functions are exposed like
ParseUri ParseAddressValue
but we could expose more?
So in case where header is not preparsed like Via, To, From .. caller must do this manually
`
hdr := msg.GetHeader("XXX")
uri, _ := parser.ParseUri(hdr.Value())

Now parsing can be also moved to fetching header, where caching is done on demand. This could
increase performance, specially in case where messages get discarded.

@emiago emiago added this to the Stable API design milestone Dec 4, 2023
@emiago emiago added the enhancement New feature or request label Dec 4, 2023
emiago added a commit that referenced this issue Dec 5, 2023
@emiago emiago closed this as completed Dec 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request in progress
Projects
None yet
Development

No branches or pull requests

1 participant