Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign upMemoize module make functions #147
Comments
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
Show comment
Hide comment
|
Oops wrong place for this issue: moved to elm/compiler#888 |
rehno-lindeque
closed this
Jan 27, 2015
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
rehno-lindeque commentedJan 27, 2015
I've been investigating the loading for our elm widgets...
It appears to me that when several widgets are instantiated (embedded), repeated calls to
makefor a large module is very slow. In particular, Bootstrap.Html.make()takes a large amount of time:One way of testing this quickly is as follows:
The above takes 12.68s on my laptop.
One quick solution might be to memoize the
makefunction. The generated function currently looks like this......I'm not 100% sure if it would be necessary to memoize the function based on the incoming
_elmenvironment, but it seems like that shouldn't be necessary. One edge case is if someone is uses different versions of the same package for different embedded widgets.