Skip to content

v0.1.15

Choose a tag to compare

@0xble 0xble released this 13 Oct 01:13
cc22cae

Faster schema copies

  • op.cloneSchema now uses a reflective deep copy instead of a JSON round trip. Copies stay fully independent: every slice, map, pointer and json.RawMessage is copied.
  • mcp.NewServer and api.Handler reuse each entry's cached schema copies instead of copying every schema for each server, handler or call. The cache is held weakly, so it never keeps a registry alive.
  • GET /openapi.json builds the document per request from current entries, so op.Add and metadata edits still show up immediately.
  • InputSchema(), OutputSchema() and OpenAPI() still return caller-owned copies. No public API changes and no expected golden changes.

Tools with many large operations get much faster tests: mercury's -race ops pass drops from about 265s to 73s.

Full change: #25