[{"data":1,"prerenderedAt":1092},["ShallowReactive",2],{"/profiler":3,"/profiler-surround":1081},{"id":4,"title":5,"body":6,"description":1055,"extension":1056,"meta":1057,"navigation":1074,"path":1078,"seo":1079,"stem":12,"__hash__":1080},"content/profiler.md","Profiler Extension",{"type":7,"value":8,"toc":1007},"minimark",[9,22,32,36,42,45,55,58,77,86,95,104,189,205,305,318,327,330,339,347,430,439,478,512,545,568,591,614,961],[10,11,15],"h1",{"id":12,"className":13},"profiler",[14],"section-heading",[16,17,21],"a",{"className":18,"href":20},[19],"section-anchor","#profiler","Profiler",[23,24,27],"h2",{"id":25,"className":26},"using-the-profiler-extension",[14],[16,28,31],{"className":29,"href":30},[19],"#using-the-profiler-extension","Using the Profiler Extension",[33,34,35],"p",{},"If you’d like your model to run faster, the profiler extension\nmay be useful to you. It includes primitives that measure how many\ntimes the procedures in your model are called during a run and how\nlong each call takes. You can use this information to where to focus\nyour speedup efforts.",[33,37,38],{},[39,40,41],"strong",{},"Caution:",[33,43,44],{},"The profiler extension is experimental. It is not yet well tested or\nuser friendly. Nonetheless, we think some users will find it useful.",[46,47,50],"h3",{"id":48,"className":49},"how-to-use",[14],[16,51,54],{"className":52,"href":53},[19],"#how-to-use","How to use",[33,56,57],{},"The profiler extension comes preinstalled. To use the extension in\nyour model, add a line to the top of your Code tab:",[59,60,61],"pre",{},[62,63,64,71,72,76],"code",{},[65,66,70],"span",{"className":67},[68,69],"token","keyword","extensions"," [",[65,73,12],{"className":74},[68,75],"variable","]",[33,78,79,80,82,83,85],{},"If your model already uses other extensions, then it already has an\n",[62,81,70],{}," line in it, so just add ",[62,84,12],{}," to the list.",[33,87,88,89],{},"For more information on using NetLogo extensions,\nsee the ",[16,90,94],{"href":91,"rel":92},"http://ccl.northwestern.edu/netlogo/docs/extensions.html",[93],"nofollow","Extensions Guide",[46,96,99],{"id":97,"className":98},"example",[14],[16,100,103],{"className":101,"href":102},[19],"#example","Example",[59,105,106],{},[62,107,108,112,113,118,121,125,126,130,132,137,138,143,144,148,149,153,155,159,160,164,166,137,170,174,175,179,181,125,185],{},[65,109,111],{"className":110},[68,75],"setup","                  ",[65,114,117],{"className":115},[68,116],"comment",";; set up the model",[119,120],"br",{},[65,122,124],{"className":123},[68,75],"profiler:start","         ",[65,127,129],{"className":128},[68,116],";; start profiling",[119,131],{},[65,133,136],{"className":134},[68,135],"command","repeat"," ",[65,139,142],{"className":140},[68,141],"number","20"," [ ",[65,145,147],{"className":146},[68,75],"go"," ]       ",[65,150,152],{"className":151},[68,116],";; run something you want to measure",[119,154],{},[65,156,158],{"className":157},[68,75],"profiler:stop","          ",[65,161,163],{"className":162},[68,116],";; stop profiling",[119,165],{},[65,167,169],{"className":168},[68,135],"print",[65,171,173],{"className":172},[68,75],"profiler:report","  ",[65,176,178],{"className":177},[68,116],";; view the results",[119,180],{},[65,182,184],{"className":183},[68,75],"profiler:reset",[65,186,188],{"className":187},[68,116],";; clear the data",[33,190,191,192,200,201,204],{},"Another way to use the profiler is to export its raw data using\nthe ",[16,193,196,199],{"href":194,"rel":195},"https://docs.netlogo.org/csv.html",[93],[62,197,198],{},"csv"," extension","\nand the ",[62,202,203],{},"profiler:data"," primitive:",[59,206,207],{},[62,208,209,143,212,137,215,218,219,221,137,227,231,174,233,236,237,240,174,242,245,246,249,174,251,137,254,143,257,260,261,264,174,266,269,270,273,174,275,137,279,137,284,174,287,291,174,293,245,296,299],{},[65,210,70],{"className":211},[68,69],[65,213,198],{"className":214},[68,75],[65,216,12],{"className":217},[68,75]," ]",[119,220],{},[65,222,224,226],{"className":223},[68,69],[119,225],{},"to",[65,228,230],{"className":229},[68,75],"profile",[119,232],{},[65,234,111],{"className":235},[68,75],"                                          ",[65,238,117],{"className":239},[68,116],[119,241],{},[65,243,124],{"className":244},[68,75],"                                 ",[65,247,129],{"className":248},[68,116],[119,250],{},[65,252,136],{"className":253},[68,135],[65,255,142],{"className":256},[68,141],[65,258,147],{"className":259},[68,75]," ]                               ",[65,262,152],{"className":263},[68,116],[119,265],{},[65,267,158],{"className":268},[68,75],"                                  ",[65,271,163],{"className":272},[68,116],[119,274],{},[65,276,278],{"className":277},[68,75],"csv:to-file",[65,280,283],{"className":281},[68,282],"string","\"profiler_data.csv\"",[65,285,203],{"className":286},[68,75],[65,288,290],{"className":289},[68,116],";; save the results",[119,292],{},[65,294,184],{"className":295},[68,75],[65,297,188],{"className":298},[68,116],[65,300,302,304],{"className":301},[68,69],[119,303],{},"end",[33,306,307,308,311,312,317],{},"Running the above procedure will write a ",[62,309,310],{},"profiler_data.csv"," file that you can then load into your\nfavorite data analysis program. Here is an example data file produced using\nthe ",[16,313,316],{"href":314,"rel":315},"https://ccl.northwestern.edu/netlogo/models/WolfSheepPredation",[93],"Wolf Sheep Predation"," model:",[59,319,325],{"className":320,"code":322,"language":323,"meta":324},[321],"language-CSV","procedure,calls,inclusive_time,exclusive_time\nEAT-SHEEP,1085,1.237283,11.637364\nDISPLAY-LABELS,20,17.389512,17.389512\nMOVE,3578,14.164451,14.164451\nGO,20,683.414619,604.773837\nGRASS,3,0.05384,0.05384\nDEATH,1085,3.172517,3.172517\nREPRODUCE-SHEEP,2493,10.265135,10.265135\nREPRODUCE-WOLVES,1039,5.599509,5.599509\n","CSV","",[62,326,322],{"__ignoreMap":324},[33,328,329],{},"Thanks to Roger Peppe for his contributions to the code.",[23,331,334],{"id":332,"className":333},"primitives",[14],[16,335,338],{"className":336,"href":337},[19],"#primitives","Primitives",[33,340,341,342,346],{},"Looking for the primitive reference for the Profiler extension? You can find ",[16,343,345],{"href":344},"/profiler/dictionary","the full reference here",".",[348,349,353,354,361,362,367,368,361,375,367,378,361,385,367,388,361,394,367,397,361,403,367,406,361,412,367,415,361,421,367,424],"div",{"id":350,"className":351},"all",[352],"prose","\n  ",[16,355,358],{"className":356,"href":357},[62],"#calls",[62,359,360],{},"profiler:calls","\n   ",[65,363,366],{"className":364},[365],"font-bold"," · "," \n  ",[16,369,372],{"className":370,"href":371},[62],"#exclusive-time",[62,373,374],{},"profiler:exclusive-time",[65,376,366],{"className":377},[365],[16,379,382],{"className":380,"href":381},[62],"#inclusive-time",[62,383,384],{},"profiler:inclusive-time",[65,386,366],{"className":387},[365],[16,389,392],{"className":390,"href":391},[62],"#start",[62,393,124],{},[65,395,366],{"className":396},[365],[16,398,401],{"className":399,"href":400},[62],"#stop",[62,402,158],{},[65,404,366],{"className":405},[365],[16,407,410],{"className":408,"href":409},[62],"#reset",[62,411,184],{},[65,413,366],{"className":414},[365],[16,416,419],{"className":417,"href":418},[62],"#report",[62,420,173],{},[65,422,366],{"className":423},[365],[16,425,428],{"className":426,"href":427},[62],"#data",[62,429,203],{},[46,431,434],{"id":432,"className":433},"all-primitives",[14],[16,435,438],{"className":436,"href":437},[19],"#all-primitives","All Primitives",[348,440,353,444,353,450,468],{"className":441,"id":443},[442],"dict_entry","calls",[46,445,447,448,353],{"id":446},"profilercalls","\n    ",[16,449,360],{"href":357},[451,452,455],"h4",{"id":453,"className":454},"profilercalls-procedure-name",[14],[16,456,447,459,353],{"className":457,"href":458},[19],"#----profilercalls-procedure-name--",[65,460,463,464],{"className":461},[462],"prim_example","profiler:calls ",[465,466,467],"i",{},"procedure-name",[33,469,470,471,474,475,477],{},"Reports the number of times that ",[472,473,467],"em",{}," was called. If\n",[472,476,467],{}," is not defined, then reports 0.",[348,479,353,482,353,487,501,507],{"className":480,"id":481},[442],"exclusive-time",[46,483,447,485,353],{"id":484},"profilerexclusive-time",[16,486,374],{"href":371},[451,488,491],{"id":489,"className":490},"profilerexclusive-time-procedure-name",[14],[16,492,447,495,353],{"className":493,"href":494},[19],"#----profilerexclusive-time-procedure-name--",[65,496,498,499],{"className":497},[462],"profiler:exclusive-time ",[465,500,467],{},[33,502,503,504,506],{},"Reports the exclusive time, in milliseconds, that\n",[472,505,467],{}," was running for. Exclusive time is the time\nfrom when the procedure was entered, until it finishes, but does not\ninclude any time spent in other user-defined procedures which it\ncalls.",[33,508,509,510,477],{},"If ",[472,511,467],{},[348,513,353,516,353,521,535,541],{"className":514,"id":515},[442],"inclusive-time",[46,517,447,519,353],{"id":518},"profilerinclusive-time",[16,520,384],{"href":381},[451,522,525],{"id":523,"className":524},"profilerinclusive-time-procedure-name",[14],[16,526,447,529,353],{"className":527,"href":528},[19],"#----profilerinclusive-time-procedure-name--",[65,530,532,533],{"className":531},[462],"profiler:inclusive-time ",[465,534,467],{},[33,536,537,538,540],{},"Reports the inclusive time, in milliseconds, that\n",[472,539,467],{}," was running for. Inclusive time is the time\nfrom when the procedure was entered, until it finishes.",[33,542,509,543,477],{},[472,544,467],{},[348,546,353,549,353,554,565],{"className":547,"id":548},[442],"start",[46,550,447,552,353],{"id":551},"profilerstart",[16,553,124],{"href":391},[451,555,558],{"id":556,"className":557},"profilerstart-1",[14],[16,559,447,562,353],{"className":560,"href":561},[19],"#----profilerstart---1",[65,563,124],{"className":564},[462],[33,566,567],{},"Instructs the profiler to begin recording user-defined procedure calls.",[348,569,353,572,353,577,588],{"className":570,"id":571},[442],"stop",[46,573,447,575,353],{"id":574},"profilerstop",[16,576,158],{"href":400},[451,578,581],{"id":579,"className":580},"profilerstop-1",[14],[16,582,447,585,353],{"className":583,"href":584},[19],"#----profilerstop---1",[65,586,158],{"className":587},[462],[33,589,590],{},"Instructs the profiler to stop recording user-defined procedure calls.",[348,592,353,595,353,600,611],{"className":593,"id":594},[442],"reset",[46,596,447,598,353],{"id":597},"profilerreset",[16,599,184],{"href":409},[451,601,604],{"id":602,"className":603},"profilerreset-1",[14],[16,605,447,608,353],{"className":606,"href":607},[19],"#----profilerreset---1",[65,609,184],{"className":610},[462],[33,612,613],{},"Instructs the profiler to erase all collected data.",[348,615,353,618,353,623,634,675,678],{"className":616,"id":617},[442],"report",[46,619,447,621,353],{"id":620},"profilerreport",[16,622,173],{"href":418},[451,624,627],{"id":625,"className":626},"profilerreport-1",[14],[16,628,447,631,353],{"className":629,"href":630},[19],"#----profilerreport---1",[65,632,173],{"className":633},[462],[33,635,636,637,640,641,657,658,670,671,674],{},"Reports a string containing a breakdown of all user-defined procedure\ncalls. The ",[62,638,639],{},"Calls"," column contains the number of times a\nuser-defined procedure was called. The ",[62,642,643,137,647,651,652,656],{},[65,644,646],{"className":645},[68,75],"Incl",[65,648,650],{"className":649},[68,75],"T","(",[65,653,655],{"className":654},[68,75],"ms",")"," column\nis the total time, in milliseconds, it took for the call to complete,\nincluding the time spent in other user-defined procedures. The\n",[62,659,660,137,664,651,667,656],{},[65,661,663],{"className":662},[68,75],"Excl",[65,665,650],{"className":666},[68,75],[65,668,655],{"className":669},[68,75]," column is the total time, in milliseconds,\nspent within that user-defined procedure, not counting other\nuser-define procedures it called. The ",[62,672,673],{},"Excl/calls"," column\nis an estimate of the time, in milliseconds, spent in that\nuser-defined procedure for each call.",[33,676,677],{},"Here is example output:",[59,679,680],{},[62,681,682,137,686,137,690,137,694,698,700,704,705,137,708,137,711,651,714,717,718,137,721,651,724,717,727,730,732,736,737,741,742,741,746,750,751,755,757,761,762,750,765,750,769,750,772,776,778,736,782,750,785,750,789,750,792,796,798,800,137,803,137,806,137,810,813,815,704,818,137,821,137,824,651,827,717,830,137,833,651,836,717,839,842,844,736,847,741,850,741,853,750,856,859,861,761,864,750,867,750,870,750,873,876,878,736,881,750,884,750,887,750,890,893,895,897,137,900,137,903,137,907,137,912,915,917,704,920,137,923,137,926,651,929,717,932,137,935,651,938,717,941,944,946,736,949,741,952,741,955,750,958],{},[65,683,685],{"className":684},[68,75],"Sorted",[65,687,689],{"className":688},[68,75],"by",[65,691,693],{"className":692},[68,75],"Exclusive",[65,695,697],{"className":696},[68,75],"Time",[119,699],{},[65,701,703],{"className":702},[68,75],"Name","                               ",[65,706,639],{"className":707},[68,75],[65,709,646],{"className":710},[68,75],[65,712,650],{"className":713},[68,75],[65,715,655],{"className":716},[68,75],") ",[65,719,663],{"className":720},[68,75],[65,722,650],{"className":723},[68,75],[65,725,655],{"className":726},[68,75],[65,728,673],{"className":729},[68,75],[119,731],{},[65,733,735],{"className":734},[68,75],"CALLTHEM","                              ",[65,738,740],{"className":739},[68,141],"13","     ",[65,743,745],{"className":744},[68,141],"26.066",[65,747,749],{"className":748},[68,141],"19.476","      ",[65,752,754],{"className":753},[68,141],"1.498",[119,756],{},[65,758,760],{"className":759},[68,75],"CALLME","                                ",[65,763,740],{"className":764},[68,141],[65,766,768],{"className":767},[68,141],"6.413",[65,770,768],{"className":771},[68,141],[65,773,775],{"className":774},[68,141],"0.493",[119,777],{},[65,779,781],{"className":780},[68,75],"REPORTME",[65,783,740],{"className":784},[68,141],[65,786,788],{"className":787},[68,141],"0.177",[65,790,788],{"className":791},[68,141],[65,793,795],{"className":794},[68,141],"0.014",[119,797],{},[119,799],{},[65,801,685],{"className":802},[68,75],[65,804,689],{"className":805},[68,75],[65,807,809],{"className":808},[68,75],"Inclusive",[65,811,697],{"className":812},[68,75],[119,814],{},[65,816,703],{"className":817},[68,75],[65,819,639],{"className":820},[68,75],[65,822,646],{"className":823},[68,75],[65,825,650],{"className":826},[68,75],[65,828,655],{"className":829},[68,75],[65,831,663],{"className":832},[68,75],[65,834,650],{"className":835},[68,75],[65,837,655],{"className":838},[68,75],[65,840,673],{"className":841},[68,75],[119,843],{},[65,845,735],{"className":846},[68,75],[65,848,740],{"className":849},[68,141],[65,851,745],{"className":852},[68,141],[65,854,749],{"className":855},[68,141],[65,857,754],{"className":858},[68,141],[119,860],{},[65,862,760],{"className":863},[68,75],[65,865,740],{"className":866},[68,141],[65,868,768],{"className":869},[68,141],[65,871,768],{"className":872},[68,141],[65,874,775],{"className":875},[68,141],[119,877],{},[65,879,781],{"className":880},[68,75],[65,882,740],{"className":883},[68,141],[65,885,788],{"className":886},[68,141],[65,888,788],{"className":889},[68,141],[65,891,795],{"className":892},[68,141],[119,894],{},[119,896],{},[65,898,685],{"className":899},[68,75],[65,901,689],{"className":902},[68,75],[65,904,906],{"className":905},[68,75],"Number",[65,908,911],{"className":909},[68,910],"reporter","of",[65,913,639],{"className":914},[68,75],[119,916],{},[65,918,703],{"className":919},[68,75],[65,921,639],{"className":922},[68,75],[65,924,646],{"className":925},[68,75],[65,927,650],{"className":928},[68,75],[65,930,655],{"className":931},[68,75],[65,933,663],{"className":934},[68,75],[65,936,650],{"className":937},[68,75],[65,939,655],{"className":940},[68,75],[65,942,673],{"className":943},[68,75],[119,945],{},[65,947,735],{"className":948},[68,75],[65,950,740],{"className":951},[68,141],[65,953,745],{"className":954},[68,141],[65,956,749],{"className":957},[68,141],[65,959,754],{"className":960},[68,141],[348,962,353,965,353,970,981,990],{"className":963,"id":964},[442],"data",[46,966,447,968,353],{"id":967},"profilerdata",[16,969,203],{"href":427},[451,971,974],{"id":972,"className":973},"profilerdata-1",[14],[16,975,447,978,353],{"className":976,"href":977},[19],"#----profilerdata---1",[65,979,203],{"className":980},[462],[33,982,983,984,346],{},"Reports a list of lists containing the results of the profiler in a format that is suitable\nfor exporting with the ",[16,985,988,199],{"href":986,"rel":987},"https://ccl.northwestern.edu/netlogo/docs/csv.html",[93],[62,989,198],{},[33,991,992,993,996,997,996,999,1002,1003,1006],{},"The first sublist contains the name of the data columns: ",[62,994,995],{},"procedure",", ",[62,998,443],{},[62,1000,1001],{},"inclusive_time"," and\n",[62,1004,1005],{},"exclusive_time",". This is followed by one sublist containing the profiler data for each user-defined\nprocedure. The reported times are in milliseconds.",{"title":324,"searchDepth":1008,"depth":1009,"links":1010},5,3,[1011,1016],{"id":25,"depth":1012,"text":31,"children":1013},2,[1014,1015],{"id":48,"depth":1009,"text":54},{"id":97,"depth":1009,"text":103},{"id":332,"depth":1012,"text":338,"children":1017},[1018,1019,1025,1030,1035,1039,1043,1047,1051],{"id":432,"depth":1009,"text":438},{"id":446,"depth":1009,"text":1020,"children":1021},"\n    profiler:calls\n  ",[1022],{"id":453,"depth":1023,"text":1024},4,"\n    profiler:calls procedure-name\n  ",{"id":484,"depth":1009,"text":1026,"children":1027},"\n    profiler:exclusive-time\n  ",[1028],{"id":489,"depth":1023,"text":1029},"\n    profiler:exclusive-time procedure-name\n  ",{"id":518,"depth":1009,"text":1031,"children":1032},"\n    profiler:inclusive-time\n  ",[1033],{"id":523,"depth":1023,"text":1034},"\n    profiler:inclusive-time procedure-name\n  ",{"id":551,"depth":1009,"text":1036,"children":1037},"\n    profiler:start\n  ",[1038],{"id":556,"depth":1023,"text":1036},{"id":574,"depth":1009,"text":1040,"children":1041},"\n    profiler:stop\n  ",[1042],{"id":579,"depth":1023,"text":1040},{"id":597,"depth":1009,"text":1044,"children":1045},"\n    profiler:reset\n  ",[1046],{"id":602,"depth":1023,"text":1044},{"id":620,"depth":1009,"text":1048,"children":1049},"\n    profiler:report\n  ",[1050],{"id":625,"depth":1023,"text":1048},{"id":967,"depth":1009,"text":1052,"children":1053},"\n    profiler:data\n  ",[1054],{"id":972,"depth":1023,"text":1052},"Documentation for the Profiler extension.","md",{"source":1058,"metadataOutputPath":1059,"projectConfig":1060,"language":1067,"inheritFrom":1075,"output":1074,"version":1061,"icon":1076,"extensionName":1077,"assetsRoot":1062},"../../external/extensions/profiler/profiler.md","content/profiler.metadata.yaml",{"version":1061,"projectRoot":346,"scanRoot":1062,"outputRoot":1063,"defaults":1064,"engine":1070,"partials":1071,"dedupeIdenticalDiskWrites":1074},"7.0.4","/home/runner/work/Helio/Helio/external/extensions/profiler","content",{"inheritFrom":1065,"language":1067,"output":1068,"extension":1056,"title":1069,"version":1061},[1066],0,"en",false,"NetLogo User Manual","mustache",{"directoryPaths":1072,"extensions":1073},[346],[1070,1056],true,[1066],"i-oui-app-search-profiler",{"shortName":12,"fullName":21},"/profiler",{"title":5,"description":1055},"RnPhCiLe_f2rSh7j461tCeF4bcglP2tqRwAaorqn7fU",[1082,1087],{"title":1083,"path":1084,"stem":1085,"description":1086},"Palette Extension Dictionary: with-transparency","/palette/with-transparency","palette/with-transparency","Documentation for the with-transparency primitive.",{"title":1088,"path":1089,"stem":1090,"description":1091},"Profiler Extension Dictionary: calls","/profiler/calls","profiler/calls","Documentation for the calls primitive.",1777657790040]