最近,我开始使用netlogo profiler来优化我的代码。 在生成报告时,我可以看到,对于其中一个程序,报告的独占时间大于包含时间。我假设专属时间应始终小于或等于包含时间。独家时间是否大于包含时间?
更新: 抱歉没有提前发布探查器转储。我试图通过将具有更长独占时间的过程分成更小的过程来找到原因,以缩小可能导致此错误的代码。请在下面找到更改代码的分析器转储。您可以看到HATCH_ROSETTES过程的独占时间大于包含时间。我认为有一些与孵化程序有关的错误,因为HATCH_ROSETTES是一个声明程序,只需要调用孵化
End of simulation run.
BEGIN PROFILING DUMP
Sorted by Exclusive Time
Name Calls Incl T(ms) Excl T(ms) Excl/calls
FIND_NEIGHBOR 2796258 270525.771 270525.771 0.097
FIND_AND_CALC_OVERLAP 2796258 297711.971 24470.228 0.009
GROW_ROSETTES 2796258 305232.636 7089.417 0.003
SEEDLING_ESTABLISHMENT 2240 4918.394 5206.214 2.324
GO 60 258415.932 2894.939 48.249
CALC_OVERLAP 2927018 2765.982 2765.982 0.001
UPDATEPLOT 60 710.640 710.640 11.844
HATCH_ROSETTES 124755 8.978 431.248 0.003
GROW_SEEDLINGS 208344 200.899 200.899 0.001
UPDATEHISTOGRAM 2 195.879 195.879 97.939
SEED_DISPERSAL 280 3.319 3.319 0.012
HERBICIDE_CONCENTRATION 6 2.028 2.028 0.338
Sorted by Inclusive Time
GROW_ROSETTES 2796258 305232.636 7089.417 0.003
FIND_AND_CALC_OVERLAP 2796258 297711.971 24470.228 0.009
FIND_NEIGHBOR 2796258 270525.771 270525.771 0.097
GO 60 258415.932 2894.939 48.249
SEEDLING_ESTABLISHMENT 2240 4918.394 5206.214 2.324
CALC_OVERLAP 2927018 2765.982 2765.982 0.001
UPDATEPLOT 60 710.640 710.640 11.844
GROW_SEEDLINGS 208344 200.899 200.899 0.001
UPDATEHISTOGRAM 2 195.879 195.879 97.939
HATCH_ROSETTES 124755 8.978 431.248 0.003
SEED_DISPERSAL 280 3.319 3.319 0.012
HERBICIDE_CONCENTRATION 6 2.028 2.028 0.338
Sorted by Number of Calls
CALC_OVERLAP 2927018 2765.982 2765.982 0.001
GROW_ROSETTES 2796258 305232.636 7089.417 0.003
FIND_AND_CALC_OVERLAP 2796258 297711.971 24470.228 0.009
FIND_NEIGHBOR 2796258 270525.771 270525.771 0.097
GROW_SEEDLINGS 208344 200.899 200.899 0.001
HATCH_ROSETTES 124755 8.978 431.248 0.003
SEEDLING_ESTABLISHMENT 2240 4918.394 5206.214 2.324
SEED_DISPERSAL 280 3.319 3.319 0.012
GO 60 258415.932 2894.939 48.249
UPDATEPLOT 60 710.640 710.640 11.844
HERBICIDE_CONCENTRATION 6 2.028 2.028 0.338
UPDATEHISTOGRAM 2 195.879 195.879 97.939
END PROFILING DUMP