Skip to content

Improve performance of eventsource parser #5862

Closed
@gr2m

Description

@gr2m

Description

This is a follow up to #5325 (comment).

I created a simple benchmark that compares @rexxars eventsource-parser and @ai-sdk/provider-utils' own implementation based on the bug report by @wong2:

https://github.com/gr2m/eventsource-parser-benchmark/#readme

Based on this particular use case, eventsource-parser-3.0.1 is

  1. ~100x faster than eventsource-parser-3.0.0, and
  2. ~10x faster than @ai-sdk/provider-utils' own implementation

I couldn't yet figure out where the performance difference between eventsource-parser-3.0.1 and @ai-sdk/provider-utils' own implementation is coming from. I'll look more into it this coming week

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions