Skip to content

🧪 Add Performance Test For Memory Usage - #439

Merged
MFA-X-AI merged 2 commits into
XpressAI:masterfrom
rabea-al:Add-perf-test
Aug 28, 2025
Merged

MFA-X-AI merged 2 commits into
XpressAI:masterfrom
rabea-al:Add-perf-test

Conversation

@rabea-al

Copy link
Copy Markdown
Contributor

Description

This PR adds a new test file reload_performance_test.py designed to measure memory performance during the "Reload All Nodes" operation in Xircuits.

Key aspects of the test:

  • Measures JS heap usage after each reload (excluding warm-up).

  • Measures total DOM node count before and after reload for diagnostics.

  • Fails if:

    • Heap delta per reload > MAX_DELTA_MB
    • Net heap growth across all reloads > MAX_NET_GROWTH_MB

The thresholds used were established based on multiple local test runs and represent a reasonable performance baseline for the current LargeCanvas.xircuits workflow.

To verify that reloading works correctly, one node was edited to remove its day output port. The test ensures that after reload, the day port reappears, confirming that node updates are successfully applied.

The test was run on both pre-PR and post-PR (Fahreza’s fix) versions. Below are the results using the same canvas:

Before PR (bad memory performance):

[Warm-up] Δheap=6.2 MB
[Run 1] Δheap=276.2 MB
[Run 2] Δheap=271.9 MB
[Run 3] Δheap=275.7 MB
[Run 4] Δheap=985.6 MB
Net heap growth: 1815.7 MB ❌

After PR (good memory performance):

[Warm-up] Δheap=-82.4 MB
[Run 1] Δheap=1.4 MB
[Run 2] Δheap=1.2 MB
[Run 3] Δheap=1.1 MB
[Run 4] Δheap=1.0 MB
Net heap growth: -77.8 MB ✅

Also added echo markers in run-ui-tests.yml around the new test to improve error traceability in GitHub Actions logs.

References

Depends on xai-tests#4 which adds the LargeCanvas.xircuits test canvas used in this performance test.

Pull Request Type

  • Xircuits Core (Jupyterlab Related changes)
  • Xircuits Canvas (Custom RD Related changes)
  • Xircuits Component Library
  • Xircuits Project Template
  • Testing Automation
  • Documentation
  • Others (Please Specify)

Type of Change

  • New feature (non-breaking change which adds functionality)
  • Bug fix (non-breaking change which fixes an issue)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Tests

To run the test locally, please follow the setup and usage instructions in the README.md file

Tested on? Specify Version.

  • Windows
  • Linux Fedora
  • Mac
  • Others (State here -> xxx )

@github-actions

Copy link
Copy Markdown

Binder 👈 Launch a binder notebook on branch rabea-al/xircuits/Add-perf-test

@rabea-al
rabea-al marked this pull request as ready for review August 28, 2025 06:25

@MFA-X-AI MFA-X-AI left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Tested and LGTM. Good work!

@MFA-X-AI
MFA-X-AI merged commit fa0bb71 into XpressAI:master Aug 28, 2025
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.

2 participants