Skip to content

Commit d3f4c22

Browse files
committed
doc: desc. "Improving evaluation performances" in MIGRATING
Signed-off-by: Xavier Delaruelle <xavier.delaruelle@cea.fr>
1 parent acaa144 commit d3f4c22

File tree

2 files changed

+51
-0
lines changed

2 files changed

+51
-0
lines changed

.hunspell.en.dic

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1321,3 +1321,4 @@ appendNoDupToList
13211321
lappendNoDup
13221322
lpop
13231323
structs
1324+
reimplementation

MIGRATING.rst

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,56 @@ Modules. It provides an overview of the new features and changed behaviors
88
that will be encountered when upgrading.
99

1010

11+
v5.7
12+
----
13+
14+
This new version is backward-compatible with previous version 5 release. It
15+
fixes bugs but also introduces new functionalities that are described in this
16+
section. See the :ref:`5.7 release notes<5.7 release notes>` for a complete
17+
list of the changes between Modules v5.6 and v5.7.
18+
19+
Improving evaluation performances
20+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
21+
22+
We observed that Modules could feel slow when evaluating more than one hundred
23+
modulefiles within a single command. To address this, several improvements
24+
have been implemented:
25+
26+
* In-memory caching of expensive operations: the results of costly operations,
27+
such as module specification comparisons, are now cached in memory.
28+
29+
* Reworked environment synchronization between Tcl interpreters: environment
30+
synchronization during Tcl modulefile evaluation has been redesigned to rely
31+
on Tcl’s internal mechanisms rather than a custom reimplementation. As part
32+
of this change, calls to the Tcl ``append`` command have been replaced with
33+
``set``, which reliably triggers synchronization when environment variables
34+
are modified.
35+
36+
* More efficient dependency checks: when verifying dependencies against loaded
37+
modules, comparisons are now limited to the subset of loaded modules that
38+
match the module root name specification, instead of comparing against all
39+
loaded modules.
40+
41+
For this work, the :command:`mb` utility was extended with new benchmark tests
42+
that loads 137 modulefiles, lists the loaded modules, and then purges them.
43+
Running this benchmark highlights the performance improvements, as shown in
44+
the table below:
45+
46+
+---------+-------------+--------------------+
47+
| | v5.6.1 | v5.7.0 |
48+
+=========+=============+====================+
49+
| load | 1038 ms | 384 ms (-63%) |
50+
+---------+-------------+--------------------+
51+
| list | 222 ms | 29 ms (-87%) |
52+
+---------+-------------+--------------------+
53+
| purge | 568 ms | 303 ms (-46%) |
54+
+---------+-------------+--------------------+
55+
56+
These measurements were obtained on a system where all modulefiles are stored
57+
on local flash storage. If your modulefiles reside on a shared network
58+
filesystem, using a `Module cache`_ is strongly recommended.
59+
60+
1161
v5.6
1262
----
1363

0 commit comments

Comments
 (0)