You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
But how about when for performance reason (when your codebase becomes huge and you see that you don't really need to source all the functions at once and it improves x100 in code speed. Say, it takes a lot of time to load the create_bin function when you seldom need it.
So what you can do is recode and remove the "create_bin" from the top autoload_functions and do it this way:
Implementation Idea
Same as #36, there would be some sort of spawn conf that would indicate if there's only 1 autoload (which is always at the top of the script) or multiple.
Single autoload - no changes to current implementation
Multiple autoload - parse the script, gather all the autoload
The text was updated successfully, but these errors were encountered:
Right now, spawn functionality expects that
autoload_functions
is located at the top of the script as implemented in https://github.com/shsdk/shcf/blob/master/core/lib/create_spawn.bash.inc#L66-L68Sometimes, for performance reason, autoload_functions is called as needed.
For instance, in
shcf_cli
code traditionally define function names and autoload them at once, like https://github.com/shsdk/shcf/blob/master/core/bin/shcf_cli#L26-L41 is fine.But how about when for performance reason (when your codebase becomes huge and you see that you don't really need to source all the functions at once and it improves x100 in code speed. Say, it takes a lot of time to load the
create_bin
function when you seldom need it.So what you can do is recode and remove the "create_bin" from the top autoload_functions and do it this way:
instead of https://github.com/shsdk/shcf/blob/master/core/bin/shcf_cli#L80-L82
Well, then spawn doesn't support it yet.
Implementation Idea
Same as #36, there would be some sort of spawn conf that would indicate if there's only 1 autoload (which is always at the top of the script) or multiple.
The text was updated successfully, but these errors were encountered: