japplegame
Is this an issue with the new type checker?
Today I encountered an issue.
After updating Elixir from version 1.17.3 to 1.18.3, the compilation time of my project increased dramatically (about 10 times longer).
After digging through the code, I managed to reproduce this issue with the following synthetic code:
# update_map_test.ex
defmodule UpdateMapTest do
def cast(value) do
result = %{
a01: nil,
a02: nil,
a03: nil,
a04: nil,
a05: nil,
a06: nil,
a07: nil,
a08: nil,
a09: nil,
a10: nil,
a11: nil,
a12: nil,
a13: nil,
a14: nil,
a15: nil,
}
result = if value[:a], do: %{result | a01: value[:a]}, else: result
result = if value[:a], do: %{result | a02: value[:a]}, else: result
result = if value[:a], do: %{result | a03: value[:a]}, else: result
result = if value[:a], do: %{result | a04: value[:a]}, else: result
result = if value[:a], do: %{result | a05: value[:a]}, else: result
result = if value[:a], do: %{result | a06: value[:a]}, else: result
result = if value[:a], do: %{result | a07: value[:a]}, else: result
result = if value[:a], do: %{result | a08: value[:a]}, else: result
result = if value[:a], do: %{result | a09: value[:a]}, else: result
result = if value[:a], do: %{result | a10: value[:a]}, else: result
result = if value[:a], do: %{result | a11: value[:a]}, else: result
result = if value[:a], do: %{result | a12: value[:a]}, else: result
result = if value[:a], do: %{result | a13: value[:a]}, else: result
result = if value[:a], do: %{result | a14: value[:a]}, else: result
result = if value[:a], do: %{result | a15: value[:a]}, else: result
{:ok, result}
end
end
$ elixir -v
Erlang/OTP 27 [erts-15.2.5] [source] [64-bit] [smp:32:12] [ds:32:12:10] [async-threads:1] [jit:ns]
Elixir 1.18.3 (compiled with Erlang/OTP 27)
$ time elixir update_map_test.ex
real 0m9,085s
user 0m10,075s
sys 0m0,694s
$ elixir -v
Erlang/OTP 27 [erts-15.2.5] [source] [64-bit] [smp:32:12] [ds:32:12:10] [async-threads:1] [jit:ns]
Elixir 1.17.3 (compiled with Erlang/OTP 27)
$ time elixir update_map_test.ex
real 0m0,342s
user 0m0,853s
sys 0m0,322s
Interestingly, when adding new fields and updates, the compilation time seems to grow exponentially.
Most Liked
japplegame
Ok.
2
Popular in Questions
I have a relationship of love and hate with Elixir. Lots of things are just absolutely right, but there are some things that are kind of ...
New
Hello!
Sorry for this astonishing simple question, but I’m really stuck. I try to set up the intellij-elixir plugin, but I don’t know ho...
New
i’m a new one to elixir
which editor can i use
vs code? or atom?
Thanks! :smiley:
New
Hello, can anybody help here..? I have a list of players and I what to delete an element, but every for loop the list is reverting to ori...
New
The Elixir Typespec docs show the following syntax for keyword lists in typespecs:
# ...
| [key: type] # keyword lis...
New
Hello everybody,
usually, I use a 29" ultra-wide monitor for VSCode which can easily accomodate explorer (files panel) + file with code ...
New
ExUnit now has describe blocks which is a welcome addition coming from RSpec. In the docs, it states that nested hierarchies of describe ...
New
Can someone explain the settings of pool_size of Ecto in config file? and what is the recommend size?
Thanks
New
Hi everyone!
I need implement if…else if…else condition from my elixir code, and anymore of this control flow structures not work proper...
New
Hello again - after a longish gap I’ve decided I really must dig into Elixir and see what’s been happening here - so I have a few questio...
New
Other popular topics
Phoenix 1.4.0 released
Phoenix 1.4 is out! This release ships with exciting new features, most notably
with HTTP2 support, improved deve...
New
TL;DR: I’ve just released an implementation of Microsoft’s IDE-independent Language Server Protocol for Elixir. It adds language support ...
New
can someone please explain to me how Enum.reduce works with maps
New
I have a relationship of love and hate with Elixir. Lots of things are just absolutely right, but there are some things that are kind of ...
New
In the Dialyzer docs ( http://erlang.org/doc/man/dialyzer.html#requesting-or-suppressing-warnings-in-source-files ), there is a way to tu...
New
Hi, this is for people who, like me, have had some friction using .html.heex templates in VSCode.
The solution seems to be, in a hyphena...
New
Elixir plugin for JetBrain’s IntelliJ Platform (including Rubymine)
This is a plugin that adds support for Elixir to JetBrains IntelliJ...
New
Hi. I’ve noticed that Windows Powershell has it’s own IEX command and you cannot access Elixir’s IEX due to the conflict. This isn’t a cr...
New
I’m not a pro in using Regex and can’t figure out why the following behaviour happens, especially if we take into account the difference ...
New
Hello guys,
I have finally made it. I created an admin interface for a framework. It’s been on my todo list for years and with the curre...
New







