Skip to content

Commit 07aa04f

Browse files
dhonysilvahappi
authored andcommitted
Remove extra "a" word
1 parent ead7ad1 commit 07aa04f

1 file changed

Lines changed: 4 additions & 5 deletions

File tree

chapters/calls.asciidoc

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ version will become old and the third version will be loaded as the
3939
current version.
4040

4141
=== Hot Code Loading
42-
As we saw there is not only a syntactic difference but
42+
As we saw there is not only a syntactic difference but
4343
also a semantic difference between a local function call and a remote function call.
4444
A remote call, or a "fully quallified call", that is a call to a
4545
function in a named module, is guaranteed to go to the latest loaded
@@ -157,7 +157,7 @@ Result = M:F(fun(X) -> X * 2 end, [1,2,3]).
157157
```
158158

159159
This dynamic invocation technique is less efficient than direct calls but provides flexibility in selecting execution paths at runtime.
160-
This can be used to implement a callback system where the a module that exports a specific set of functions and you just pass the module name around.
160+
This can be used to implement a callback system where the module that exports a specific set of functions and you just pass the module name around.
161161
This technique makes it much harder for analytic tools like Dialyzer to find errors in the code since the call graph is not known at compile time.
162162

163163

@@ -189,13 +189,12 @@ Function call efficiency in Erlang follows a clear hierarchy, as outlined in the
189189

190190
Explicit calls, both local and remote (`foo()`, `m:foo()`) are the most efficient.
191191
I would like to add that the most efficient call is a local call to a function in the same module. This is because the call can be resolved at compile time and the function can be inlined. This is not possible for a remote call since the module can be changed at runtime.
192-
Even though the JIT compiler can do a good job with remote calls it does not inline them as of OTP 27.
192+
Even though the JIT compiler can do a good job with remote calls it does not inline them as of OTP 27.
193193

194194
Calling a closure (`Fun()`, `apply(Fun, [])`) is slightly slower but still efficient.
195195

196-
Applying a function () (`Mod:Name()`, `apply(Mod, Name, [])`) with a known number of arguments at compile time is next in efficiency. (You can not apply a function that is not exported from a module.)
196+
Applying a function () (`Mod:Name()`, `apply(Mod, Name, [])`) with a known number of arguments at compile time is next in efficiency. (You can not apply a function that is not exported from a module.)
197197

198198
Applying an exported function with an unknown number of arguments (`apply(Mod, Name, Args)`) is the least efficient.
199199

200200
The Erlang runtime system is optimized for local calls and remote calls to the current version of a module. Hot code loading is a powerful feature that enables live updates to running systems, but it comes with performance trade-offs. It is also important to understand that reloading a module two times will purge the old version of the module and any references to it will crash the process holding the reference.
201-

0 commit comments

Comments
 (0)