Uploaded image for project: 'Magnolia'
  1. Magnolia
  2. MAGNOLIA-8213

Parallelization of startup

XMLWordPrintable

    • Icon: Improvement Improvement
    • Resolution: Unresolved
    • Icon: Neutral Neutral
    • None
    • None
    • core
    • None

      I made some changes to the core to parallelize the starup. On my system this accelerates the startup by approx. 25%. It is a proof of concept to show what is possible, but still seems solid to me and might even be good enough for production.

      Mainly the startup of modules in ModuleManagerImpl is parallelized. It relies on CompletableFuture and has a simple, but working logic that leaves room for improvement. Now as many threads as modules are started at the same time and each of them checks if the modules that it depends on have started before starting itself. A more elegant solution would be to create threads for starting a module that start when the threads of the modules it depends on have finished, but this needs a more complicated logic of breaking down the module hierarchy. Not too complicated, but may need some time to implement.
      On top I made some other methods run async like info.magnolia.config.source.yaml.YamlConfigurationSource.loadAndRegister. 
      We might be able to also squeeze some seconds out of info.magnolia.cms.beans.config.ConfigLoader.getMainComponents() and the GuiceComponentProviderBuilder, but so far I haven't managed.

        Acceptance criteria

              Unassigned Unassigned
              marc.johnen Marc Johnen
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Created:
                Updated:

                  Task DoD