Commit 8b9bf62
Reduce memory usage in IEx autocomplete module listing
Use :erlang.loaded/0 instead of :code.all_loaded/0 since we only need
module names, not file paths. The latter copies the full path for every
loaded module, which on production systems with many dependencies
caused significant memory spikes (measured 2.8MB -> 172KB on a real pod).
Also replace Enum.sort/1 |> Enum.dedup/1 with :lists.usort/1 to
eliminate one intermediate list allocation.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>1 parent 6fd161d commit 8b9bf62
1 file changed
Lines changed: 2 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
604 | 604 | | |
605 | 605 | | |
606 | 606 | | |
607 | | - | |
608 | | - | |
| 607 | + | |
609 | 608 | | |
610 | 609 | | |
611 | 610 | | |
| |||
615 | 614 | | |
616 | 615 | | |
617 | 616 | | |
618 | | - | |
| 617 | + | |
619 | 618 | | |
620 | 619 | | |
621 | 620 | | |
| |||
0 commit comments