grosser/kennel

only load project that is requested

grosser opened this issue · 4 comments

atm we always load all projects which takes a few seconds, would be nice to avoid that
autoload parts ... load only project when project.rb project/project.rb project_foo -> project/foo.rb exists

expected savings: ~1s (tried by hardcoding the correct require) (1.6s -> 0.5s to run generate)

we'd need to store a project -> file(s) map to make this work, maybe store after running generate
alternatively it could just support projects with the exact right path and fallback to all for the rest, but given our current messy project layout that would be almost nobody

zdrve commented

With the current filtering mechanisms, that is going to rely on introducing a new restriction: that the kennel_id of a project must match (1:1 reversible) the class / filename.

yeah, that will be hard
we could say "it needs to be either in x.rb or x/x.rb" etc to be flexible but it's not going to be super reliable

zdrve commented

Would be perhaps pretty straightforward with the generated_from concept: https://github.com/zdrve/kennel/pull/1