Skip to content

fix(java): skip wasm setResolverState when flag state is unchanged#404

Merged
nicklasl merged 1 commit into
spotify:mainfrom
OskarKjellin:skip-noop-state-updates
May 12, 2026
Merged

fix(java): skip wasm setResolverState when flag state is unchanged#404
nicklasl merged 1 commit into
spotify:mainfrom
OskarKjellin:skip-noop-state-updates

Conversation

@OskarKjellin
Copy link
Copy Markdown
Contributor

The periodic state refresh unconditionally pushed the state blob through all wasm pool instances every poll interval (default 15s), even when the state hadn't changed. Each setResolverState call runs wasm execution across all pool slots — expensive CPU work for a no-op when the flag definitions haven't evolved.

Compare the new state bytes with the previous via Arrays.equals and skip setResolverState when unchanged. Log flushing still runs every cycle regardless.

The periodic state refresh unconditionally pushed the state blob
through all wasm pool instances every poll interval (default 15s),
even when the state hadn't changed. Each setResolverState call runs
wasm execution across all pool slots — expensive CPU work for a no-op
when the flag definitions haven't evolved.

Compare the new state bytes with the previous via Arrays.equals and
skip setResolverState when unchanged. Log flushing still runs every
cycle regardless.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@nicklasl nicklasl changed the title Skip wasm setResolverState when flag state is unchanged fix(java): skip wasm setResolverState when flag state is unchanged May 12, 2026
@nicklasl nicklasl merged commit b10d1ec into spotify:main May 12, 2026
2 of 3 checks passed
@OskarKjellin OskarKjellin deleted the skip-noop-state-updates branch May 12, 2026 09:36
@github-actions github-actions Bot mentioned this pull request May 12, 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