Skip to content

improve hot reload times in granian even more#5499

Merged
adhami3310 merged 1 commit into
mainfrom
improve-hot-reload-times-in-granian-even-more
Jun 26, 2025
Merged

improve hot reload times in granian even more#5499
adhami3310 merged 1 commit into
mainfrom
improve-hot-reload-times-in-granian-even-more

Conversation

@adhami3310
Copy link
Copy Markdown
Member

we go down from ~100ms down to ~20ms by simply caching reflex.app module (and its deps)

Copy link
Copy Markdown
Contributor

@greptile-apps greptile-apps Bot left a comment

Choose a reason for hiding this comment

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

PR Summary

Optimizes hot reload performance in Granian backend by implementing module caching, resulting in significant latency reduction from ~100ms to ~20ms.

  • Modified reflex/utils/exec.py to pre-import reflex.app module before Granian backend initialization, enabling module caching
  • Implementation specifically targets backend reload time optimization through Python module cache utilization
  • Change is minimally invasive but delivers ~80% improvement in hot reload responsiveness

1 file reviewed, no comments
Edit PR Review Bot Settings | Greptile

@codspeed-hq
Copy link
Copy Markdown

codspeed-hq Bot commented Jun 26, 2025

CodSpeed Performance Report

Merging #5499 will not alter performance

Comparing improve-hot-reload-times-in-granian-even-more (e9d115c) with main (e99dbe2)

Summary

✅ 8 untouched benchmarks

@adhami3310 adhami3310 merged commit 7b4df17 into main Jun 26, 2025
40 of 41 checks passed
@adhami3310 adhami3310 deleted the improve-hot-reload-times-in-granian-even-more branch June 26, 2025 01:54
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