Skip to content

Conversation

@YashJainSC
Copy link
Contributor

@YashJainSC YashJainSC commented Jan 14, 2026

Problem

AgentAttributes.fromStringMap() was very slow on very first invocation for empty maps taking upto 1 seconds in some cases.

Solution

Add early return when the input map is empty, returning a default
AgentAttributes() directly. This avoids triggering Klaxon parsing
when there's nothing to parse.

@changeset-bot
Copy link

changeset-bot bot commented Jan 14, 2026

🦋 Changeset detected

Latest commit: 02df2e6

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
client-sdk-android Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@CLAassistant
Copy link

CLAassistant commented Jan 14, 2026

CLA assistant check
All committers have signed the CLA.

@YashJainSC YashJainSC force-pushed the perf/empty-map-early-return branch 2 times, most recently from cf87af9 to 9dc6620 Compare January 14, 2026 10:00
@YashJainSC YashJainSC force-pushed the perf/empty-map-early-return branch 2 times, most recently from 2678c19 to dc35c96 Compare January 15, 2026 03:13
@YashJainSC YashJainSC requested a review from davidliu January 15, 2026 03:15
@YashJainSC YashJainSC force-pushed the perf/empty-map-early-return branch from dc35c96 to 02df2e6 Compare January 15, 2026 03:25
@davidliu
Copy link
Contributor

LGTM! I think I'll also switch to kotlinx serialization here asap. Didn't think the first start time for klaxon was this drastic.

@davidliu davidliu merged commit 54fadd1 into livekit:main Jan 15, 2026
2 checks passed
@davidliu davidliu mentioned this pull request Jan 15, 2026
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.

3 participants