Skip to content

feat: implement performance instrumentation v2#1285

Open
aviralgarg05 wants to merge 1 commit intoeigent-ai:mainfrom
aviralgarg05:feat/performance-measurement-v2
Open

feat: implement performance instrumentation v2#1285
aviralgarg05 wants to merge 1 commit intoeigent-ai:mainfrom
aviralgarg05:feat/performance-measurement-v2

Conversation

@aviralgarg05
Copy link

Related Issue

Closes #911

Description

This PR implements comprehensive performance instrumentation across the Eigent backend and Electron startup process. It introduces a centralized PerfTimer utility to capture execution durations and log them with context, enabling better bottleneck identification and observability.

Key Changes:

  1. Instrumentation Utility: Created backend/app/utils/perf_timer.py providing the PerfTimer context manager and @perf_measure decorator using standard Python logging.
  2. Agent & Workforce Instrumentation:
    • chat_service.py: Instrumented session start, workforce construction, and task decomposition.
    • workforce.py: Instrumented the high-level task decomposition and workforce start logic.
    • single_agent_worker.py: Instrumented overall task processing and specific agent steps.
    • listen_chat_agent.py: Instrumented both synchronous and asynchronous agent steps and tool executions.
  3. Startup Performance:
    • backend/main.py: Added module load timing.
    • electron/main/init.ts: Instrumented the backend spawn process and health check duration.
  4. Testing: Added backend/tests/unit/utils/test_perf_timer.py with 19 test cases covering sync/async usage and exception handling.

What is the purpose of this pull request?

  • Bug fix
  • New Feature
  • Documentation update
  • Other

Contribution Guidelines Acknowledgement

Copy link
Contributor

@Wendong-Fan Wendong-Fan left a comment

Choose a reason for hiding this comment

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

thanks @aviralgarg05 , could you share a sample PerfTimer output so we can analyze the current performance bottlenecks?

@Wendong-Fan Wendong-Fan added this to the Sprint 15 milestone Feb 17, 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.

[Feature Request] Mesuring the performance of Eigent setup time and task execution time, identify problems and improving performance

2 participants