I’m trying to use PackageCompiler.jl to reduce the startup time for a server that uses some custom modules (CreditScoreEstimation, WalletOptimization, UserProfiles).
approvalPath = joinpath(@__DIR__, "Algorithms-Approval" )
union!(LOAD_PATH, [approvalPath])
println("Loading Credit Score Module")
@time import CreditScoreEstimation
walletOptimPath = joinpath(@__DIR__, "Algorithms-Wallet-Optimization" )
union!(LOAD_PATH, [walletOptimPath])
println("Loading Wallet Optimzation Module")
@time import WalletOptimization
println("Loading User Profile Module")
userProfilePath = joinpath(@__DIR__, "Algorithms-User-Profiles" )
union!(LOAD_PATH, [userProfilePath])
@time import UserProfiles
println("Setting up sysimage...")
using PackageCompiler
pkgList = [:Distributions, :Joseki, :DataFrames, :CSV, :AWS, :AWSS3, :CreditScoreEstimation, :WalletOptimization, :UserProfiles]
@time create_sysimage(pkgList, sysimage_path="/home/ccg/julia_server/server/sys_server.so", precompile_execution_file="precompile_server.jl", cpu_target="generic")
However, when I try to do this, I get the error message
LoadError: package(s) CreditScoreEstimation, WalletOptimization, UserProfiles not in project
If I remove the packages {:CreditScoreEstimation, :WalletOptimization, :UserProfiles} from the list, it works, but the associated functions are not precompiled (the re-build function takes 10 seconds the first time and 0.3 seconds the second time). My guess is that this is happening because they’re modules and not proper packages. My questions are:
(1) Is there a way to get PackageCompiler.jl to simply precompile modules or even just functions?
(2) If I HAVE to put the code-to-compile into a package, is there a way to do this while having all the source code stored locally without sending this code to a remote repository like Github?
(3) If I HAVE to have the code hosted remotely, is there a way to so this for Bitbucket and not Github?