Skip to content

Miscellaneous performance optimizations - #3624

Open
ChihweiLHBird wants to merge 6 commits into
spinframework:mainfrom
ChihweiLHBird:zhiwei/optimization-1
Open

Miscellaneous performance optimizations#3624
ChihweiLHBird wants to merge 6 commits into
spinframework:mainfrom
ChihweiLHBird:zhiwei/optimization-1

Conversation

@ChihweiLHBird

@ChihweiLHBird ChihweiLHBird commented Jul 18, 2026

Copy link
Copy Markdown
Contributor

Summary

Five small, low-risk hot-path cleanups (one commit each), no behavior change for the CLI:

  • telemetry: cache the OTel logs enablement check (OnceLock) instead of re-reading env vars on every guest log write
  • trigger-http: resolve the app name once at server construction instead of deserializing metadata on every request
  • key-value-spin: exists uses SELECT 1 … LIMIT 1 instead of fetching the whole value BLOB via get
  • llm-remote-http: move embedding vectors out of the response instead of cloning them
  • llm-local: clone only eos_token_id instead of the whole llama Config

Notes

  • Malformed name metadata now fails at server construction instead of per request (already caught earlier by the default factor stack, so unobservable in practice).
  • SQLite exists no longer decodes the value, matching the other backends' native existence probes.

@ChihweiLHBird
ChihweiLHBird marked this pull request as ready for review July 22, 2026 07:50
Comment thread crates/telemetry/src/logs.rs Outdated
Comment thread crates/llm-local/src/llama.rs Outdated
Comment thread crates/llm-remote-http/src/open_ai/schemas.rs Outdated
@ChihweiLHBird
ChihweiLHBird force-pushed the zhiwei/optimization-1 branch 2 times, most recently from 4815de8 to 193b2ef Compare August 27, 2026 03:09
…vironment on every guest log write.

Signed-off-by: Zhiwei Liang <zhiwei.liang@zliang.me>
… of deserializing it from metadata on every request.

Signed-off-by: Zhiwei Liang <zhiwei.liang@zliang.me>
…SELECT ... LIMIT 1 instead of fetching the whole value.

Signed-off-by: Zhiwei Liang <zhiwei.liang@zliang.me>
@ChihweiLHBird
ChihweiLHBird force-pushed the zhiwei/optimization-1 branch from 193b2ef to c29c5bc Compare August 27, 2026 03:09
Callers should not have to cache a process-lifetime env check.

Signed-off-by: Zhiwei Liang <zhiwei.liang@zliang.me>
@ChihweiLHBird
ChihweiLHBird marked this pull request as draft August 27, 2026 03:25
Signed-off-by: Zhiwei Liang <zhiwei.liang@zliang.me>
Signed-off-by: Zhiwei Liang <zhiwei.liang@zliang.me>
@ChihweiLHBird
ChihweiLHBird marked this pull request as ready for review August 27, 2026 04:26
@ChihweiLHBird
ChihweiLHBird requested a review from itowlson August 27, 2026 04:27

@itowlson itowlson left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM - thanks!

@calebschoepp any concerns on the OTel tweak?

@itowlson
itowlson requested a review from calebschoepp August 27, 2026 19:11

@calebschoepp calebschoepp left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice catch!

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