cbrain icon indicating copy to clipboard operation
cbrain copied to clipboard

Improve Ruby search path scanning at boot time

Open prioux opened this issue 5 years ago • 1 comments

When a CBRAIN install has lots of plugins, the search path for Ruby code can get quite big, instead of being constant. This is because we add on path per userfile file type, as seen in config/application.rb:

    # CBRAIN Plugins load paths: add directories for each Userfile model
    config.eager_load_paths += Dir[ * Dir.glob("#{config.root}/cbrain_plugins/installed-plugins/userfiles/*") ]

One reason is that each directory there contains more than just a ruby model, it might contain views and other local support code.

We need to find a way to join all of this together in some sort of single structure, maybe by creating better symlinks in the installed-plugins subtree. We'd need to enhance the rake task cbrain:plugins:install:all

This is normally not much of a problem, except on VERY VERY slow filesystems, where at boot time the scanning of each directory to find each model file can make the entrire process excruciating. Do we even need to improve this, if the fault is really outside of CBRAIN?

prioux avatar May 14 '19 17:05 prioux

I'm raising the priority of this a little now.

prioux avatar Dec 15 '22 16:12 prioux