updated eventsource-stream to eventsource-stream2#559
Open
SneedSeedFeed wants to merge 2 commits into
Open
Conversation
Author
|
bumped the version to 0.4 which (should) be less likely to break semver in the future since there were some leftovers from the original that caught me out. Additionally the performance should be significantly improved by a further 4x or so since I've removed an intermediate stream and made the parser not re-scan the SSE line. In informal testing (my benchmarks can only compare against myself not |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
eventsource-stream has not been updated since February of 2022. I ported my parser from
sseertoeventsource-streamand opened a pr that fixes a performance issue, after emailing Julian a few months back I got no reply so I decided to fork it instead.eventsource-stream2 is nearly exactly the same just with a faster parser and one less error variant since the parser can never actually error, so for async-openai it's literally just a drop-in replacement as you don't depend on the
EventStreamError::Parservariant I removed. The change is so drop-in all I had to do was change the Cargo.toml lol.In terms of real world performance uplift it wont be much but it should improve the worst case of large SSE lines, in some benchmarks I found a 50x uplift in the best case of a 1024 byte line with the average uplift being closer to 4x.