From a759c9d56aa42774ef516b42019f136c9584adea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Valim?= Date: Thu, 15 Feb 2024 11:17:20 +0100 Subject: [PATCH] Document modules also improve stacktraces, closes #2485 --- lib/livebook/notebook/learn/intro_to_livebook.livemd | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/livebook/notebook/learn/intro_to_livebook.livemd b/lib/livebook/notebook/learn/intro_to_livebook.livemd index 0d8a9c204..16a6daaa0 100644 --- a/lib/livebook/notebook/learn/intro_to_livebook.livemd +++ b/lib/livebook/notebook/learn/intro_to_livebook.livemd @@ -356,8 +356,11 @@ than the previous `Enum.reduce/3` call. While the call `Bench.sum()` itself is evaluated, the one million iterations of `Enum.reduce/3` happen inside a module, which is compiled. -If a notebook is performing slower than expected, consider moving -the bulk of the execution to inside modules. +Another benefit is compiling code is that exceptions often have +better stacktraces and error messages. Therefore, if a notebook is +performing slower than expected or you need more information in case +of failures, consider moving the bulk of the execution to inside +modules. ## Running tests