-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
the number of " .jl "File of included affects the speed of calling some function ? #8834
Comments
Parsing and compiling everything takes time - longer than we would like, right now. The end-user issue here will be addressed by #8745, and there are already other issues for compiler performance. |
I'm a little confused by this report. |
WWWQ_pre_days_fun.jl is function .jl ,as follow.(part) function WWWQ_pre_days_fun(TGP::tradeGeneralParameters, data::Dict{Date,Dict{String,Array{kBarData,1}}},windowLength::Int64,enterN::Float64 ,exitN::Float64,baseTime::Int64,barMin::Int64,isMustCloseToday::Bool)
println("WWWQ_pre_days_fun!")
instrumentInfo = getInstrumentInfo(TGP.instrument );
tradeFeeTh = instrumentInfo[1].TradeFee # 计算交易费用
if TGP.instrument=="IF"
impactCostUnit = 1.0*instrumentInfo[1].OneTickValue # 计算冲击成本,暂时冲击成本以1个TICK来计算
else
impactCostUnit = 1.0*instrumentInfo[1].OneTickValue # 计算冲击成本,暂时冲击成本以1个TICK来计算
end
DrawDownTh = TGP.highDownTh;
DrawUpTh = TGP.lowUpTh;
StopLossTh = TGP.stopLossTh;
StopProfTh = TGP.stopProfTh;
lastOpenTime = TGP.lastOpenTime;
lastCloseTime = TGP.lastCloseTime;
instrument = TGP.instrument;
multiplier = TGP.multiplier
tradeVolume = TGP. tradeVolume ;#手数 有问题,商品的手数有不同的变化
maxTradeCount = TGP. maxTradeCount; #当日最大交易次数
strategyName = TGP.strategyName
tradeDates = sort(collect(keys(data)))
tradeFlows = tradeFlow[];
# 默认参数,主要是一些辅助参数,估计差问题不大
#historyDataDays = 10; # 10:在当天获取当天前10天的数据。慢周期往往需要更长的时间数据
marketCloseTime = lastCloseTime; # COM:15:00 IF:1515
shiftTime = marketCloseTime-barMin;# 在正常的情况下,迁月在交割日前完成,但如果在交割日当天迁月,则不能晚于1500
shiftBarLength = (marketCloseTime-shiftTime)/barMin +2; # 在迁月循还中,循还的长度
#
startTime1 = time();
println("$strategyName 策略开始启动......")
........
end |
11.5 seconds or 3.9 seconds does not include the time of processing the includes. they are only the time of the function run. |
thanks! ------------------ 原始邮件 ------------------ why??? — |
thanks! ------------------ 原始邮件 ------------------ I'm a little confused by this report. WWWQ_pre_days_fun.jl is a source file, not a function. Are you waiting for all these includes to be processed, then calling a function defined in those files, or timing how long it takes to include everything? — |
sorry, i make a mistake. it is closed! thanks all. |
i have a issue:
if the program has more include .jl Files , But when the program calls some function of a .jl File included, the time of running the function has a different from less include File.
My Test:
if my program adds the Head A, the time of calling the function WWWQ_pre_days_fun.jl only is 11.504999876022339 seconds.
but my program adds the Head B, the time of calling the function WWWQ_pre_days_fun.jl only is
3.9060001373291016 seconds!
The text was updated successfully, but these errors were encountered: