Skip to content

feat: O(1) function call lookups#6453

Open
AmaadMartin wants to merge 2 commits into
google:mainfrom
AmaadMartin:feat/find-matching-fc-index
Open

feat: O(1) function call lookups#6453
AmaadMartin wants to merge 2 commits into
google:mainfrom
AmaadMartin:feat/find-matching-fc-index

Conversation

@AmaadMartin

Copy link
Copy Markdown
Collaborator

PR Description

Optimized function call lookups in adk-python to be O(1) by introducing a cached function_call_index on the Session model.
This refactor also introduces Session.get_matching_function_call() natively to eliminate leaky abstractions into static helper functions, resulting in a cleaner and highly performant architecture.

Complexity & Performance

  • Function Call Index lookups operate natively in O(1) time.
  • Re-indexing is purely incremental, executing strictly over new events rather than recalculating the entire index.
  • E2E benchmarks demonstrate O(1) scalability up to 10,000+ events per session efficiently.

Testing

  • All 194 unit tests successfully passing with full line and branch coverage.
  • Validated via isolated E2E testing framework manually triggering >10000 sequential events.

Review Board

  • Passes Complexity Auditor review (Removed over-engineered injection logic).

@adk-bot adk-bot added the services [Component] This issue is related to runtime services, e.g. sessions, memory, artifacts, etc label Jul 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

services [Component] This issue is related to runtime services, e.g. sessions, memory, artifacts, etc

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants