Skip to content

Bug: enhanced performance of LiveDebugger init#928

Merged
kraleppa merged 6 commits intomainfrom
927-after-upgrade-to-06-backend-takes-more-than-15-seconds-to-start
Feb 19, 2026
Merged

Bug: enhanced performance of LiveDebugger init#928
kraleppa merged 6 commits intomainfrom
927-after-upgrade-to-06-backend-takes-more-than-15-seconds-to-start

Conversation

@kraleppa
Copy link
Member

@kraleppa kraleppa commented Feb 18, 2026

Basically the problem was that we made some heavy file system operations on TracingManager GenServer init, which caused a significant lag. Apparently, we were doing some operations two times (once when setting up tracing, secondly when setting up recompilation monitoring).

It was fine for MacOS but on nixOS it started to cause some issues

I unified those two functions and moved it out from GenServer init, so now setup should not be that long

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR refactors callback tracing initialization to avoid fetching/processing the module list multiple times by reusing a single “live modules + compiled paths” query for both trace-pattern setup and file-system monitoring.

Changes:

  • Removed Paths.compiled_modules_directories/0 and its dedicated test; moved “live modules + compiled path” discovery into Callbacks.
  • Added Callbacks.all_live_modules_with_paths/0 and list-based Callbacks.all_callbacks/1 to reuse module lists efficiently.
  • Updated tracing initialization to setup_tracing_with_monitoring!/1, applying trace patterns and starting the FileSystem monitor in one pass; adjusted tests accordingly.

Reviewed changes

Copilot reviewed 8 out of 9 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
test/services/callback_tracer/queries/paths_test.exs Removed tests for the deleted Paths query module.
test/services/callback_tracer/queries/callbacks_test.exs Updated Mox stubs to include live_module?/1 due to new filtering path.
test/services/callback_tracer/gen_servers/tracing_manager_test.exs Updated init/setup expectations to match new monitoring startup location.
test/services/callback_tracer/actions/tracing_test.exs Renamed/updated setup tests and added coverage for multi-directory monitoring during setup.
lib/live_debugger/services/callback_tracer/queries/paths.ex Deleted; functionality superseded by Callbacks.all_live_modules_with_paths/0.
lib/live_debugger/services/callback_tracer/queries/callbacks.ex Added live-module/path query + overloads for callback building from a provided module list.
lib/live_debugger/services/callback_tracer/gen_servers/tracing_manager.ex Switched to setup_tracing_with_monitoring!/1; removed monitoring call from init/1.
lib/live_debugger/services/callback_tracer/actions/tracing.ex Combined tracing setup + file monitoring; trace-pattern application now accepts pre-fetched modules.
.gitignore Ignored shell.nix.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Contributor

@hhubert6 hhubert6 left a comment

Choose a reason for hiding this comment

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

🐬

Copy link
Contributor

@srzeszut srzeszut left a comment

Choose a reason for hiding this comment

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

👌

@kraleppa kraleppa merged commit 312f406 into main Feb 19, 2026
4 of 5 checks passed
@kraleppa kraleppa deleted the 927-after-upgrade-to-06-backend-takes-more-than-15-seconds-to-start branch February 19, 2026 12:21
kraleppa added a commit that referenced this pull request Feb 26, 2026
* Moved recompilation monitoring setup after tracing setup

* Add nix to gitignore

* Fix tests

* Enhanced performance of LiveDebugger initialization

* Mix format

* Don't duplicate monitor process
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.

After upgrade to 0.6, backend takes more than 15 seconds to start

4 participants