Skip to content

module caching #310

Closed
Closed

Description

@bryanjos

Caching of modules that have been compiled. The cached version should be used if the beam file has not been modified since the module was compiled. When the beam file is modified, that cache should be invalidated.

Activity

  1. bryanjos commented on Aug 12, 2017

    @bryanjos
    CollaboratorAuthor

    I think steps to make this happen include:

    • Keeping track of the beam file's modified date
    • Storing the generated JavaScript AST for modules
    • When a beam file's modified date does not match, do a full compile

    What I'm not sure of is how to handle cases when the module itself hasn't changed and some other module uses a function on that module that was previously unused and not compiled. I am am guessing in order to handle that, the cache may need to keep track of functions compiled. Then at least if one if the above happens, it can force a cache invalidation

  2. bryanjos commented on Aug 12, 2017

    @bryanjos
    CollaboratorAuthor

    I am also not sure currently how the cache should be stored

  3. vans163 commented on Aug 13, 2017

    @vans163
    Contributor

    cache storage location could be set with a mix param? right beside input, output, etc?
    a default location in the priv directory seems right, perhaps under elixir_script/ folder which is already required.

  4. bryanjos commented on Aug 13, 2017

    @bryanjos
    CollaboratorAuthor

    There isn't a need for the caching to be configurable or in the priv folder. The best places are probably the _build folder somewhere or a temp directory

  5. vans163 commented on Aug 13, 2017

    @vans163
    Contributor

    I thought you might want to use the same cache with multiple elixirscript projects, the performance benefits of this is probably negligible.

    if by default temp dir is outside _build, such as in ~/.config or something, it gets really annoying to pass through the project as a volume to containers and such.

  6. vans163 commented on Sep 6, 2017

    @vans163
    Contributor
    19:20:32.543 [info]  FindUsedModules took: 2263
    19:20:32.894 [info]  FindUsedFunctions took: 351
    19:20:33.638 [info]  Translate took: 744
    19:20:34.236 [info]  Output took: 598
    19:20:34.249 [info]  Compile took: 3970
    

    Current compilation step times in milliseconds. This is not counting the time spent inside elixir compiler so add an extra 1-2 seconds.

    Why is output step taking so long? half the time is the cost of modules = ElixirScript.State.list_modules(pid)

  7. bryanjos commented on Sep 6, 2017

    @bryanjos
    CollaboratorAuthor

    It could be related to how the state is stored. It's possible that step will be slowest because it does the loading of modules for most of modules being compiled

  8. added this to the 0.31.0 milestone on Sep 7, 2017
  9. removed this from the 0.31.0 milestone on Sep 20, 2017
  10. added this to the 0.32.0 milestone on Oct 21, 2017
  11. removed this from the 0.32.0 milestone on Nov 7, 2017
  12. bryanjos commented on Nov 7, 2017

    @bryanjos
    CollaboratorAuthor

    Closing this in favor of #438 which is a bit more directed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions