[{"data":1,"prerenderedAt":1884},["ShallowReactive",2],{"navigation_docs":3,"-advanced-go-benchmarking-and-profiling":377,"-advanced-go-benchmarking-and-profiling-surround":1879},[4,39,114,144,184,244,293,362],{"title":5,"icon":6,"path":7,"stem":8,"children":9,"page":6},"Getting Started",false,"\u002Fgetting-started","1.getting-started",[10,15,20,25,30,35],{"title":11,"path":12,"stem":13,"icon":14},"Learning Path","\u002Fgetting-started\u002Flearning-path","1.getting-started\u002F1.learning-path","i-lucide-map",{"title":16,"path":17,"stem":18,"icon":19},"Introduction","\u002Fgetting-started\u002Fintroduction","1.getting-started\u002F2.introduction","i-lucide-house",{"title":21,"path":22,"stem":23,"icon":24},"Installation","\u002Fgetting-started\u002Finstallation","1.getting-started\u002F3.installation","i-lucide-download",{"title":26,"path":27,"stem":28,"icon":29},"Your First Program","\u002Fgetting-started\u002Ffirst-program","1.getting-started\u002F4.first-program","i-lucide-play",{"title":31,"path":32,"stem":33,"icon":34},"Modules and Dependencies","\u002Fgetting-started\u002Fmodules-and-dependencies","1.getting-started\u002F5.modules-and-dependencies","i-lucide-package-open",{"title":36,"path":37,"stem":38,"icon":34},"Advanced Modules","\u002Fgetting-started\u002Fadvanced-modules","1.getting-started\u002F6.advanced-modules",{"title":40,"path":41,"stem":42,"children":43,"page":6},"Fundamentals","\u002Ffundamentals","2.fundamentals",[44,49,54,59,64,69,74,79,84,89,94,99,104,109],{"title":45,"path":46,"stem":47,"icon":48},"Program Structure","\u002Ffundamentals\u002Fprogram-structure","2.fundamentals\u002F1.program-structure","i-lucide-workflow",{"title":50,"path":51,"stem":52,"icon":53},"Structs and Methods","\u002Ffundamentals\u002Fstructs-and-methods","2.fundamentals\u002F10.structs-and-methods","i-lucide-box",{"title":55,"path":56,"stem":57,"icon":58},"Interfaces","\u002Ffundamentals\u002Finterfaces","2.fundamentals\u002F11.interfaces","i-lucide-plug",{"title":60,"path":61,"stem":62,"icon":63},"Error Handling","\u002Ffundamentals\u002Ferrors","2.fundamentals\u002F12.errors","i-lucide-triangle-alert",{"title":65,"path":66,"stem":67,"icon":68},"Defined Types and Type Aliases","\u002Ffundamentals\u002Fdefined-types","2.fundamentals\u002F13.defined-types","i-lucide-tags",{"title":70,"path":71,"stem":72,"icon":73},"Generics","\u002Ffundamentals\u002Fgenerics","2.fundamentals\u002F14.generics","i-lucide-blocks",{"title":75,"path":76,"stem":77,"icon":78},"Project Structure","\u002Ffundamentals\u002Fproject-structure","2.fundamentals\u002F2.project-structure","i-lucide-folder-tree",{"title":80,"path":81,"stem":82,"icon":83},"Project Layout","\u002Ffundamentals\u002Fproject-layout","2.fundamentals\u002F3.project-layout","i-lucide-layout",{"title":85,"path":86,"stem":87,"icon":88},"Variables and Data Types","\u002Ffundamentals\u002Fvariables-and-types","2.fundamentals\u002F4.variables-and-types","i-lucide-variable",{"title":90,"path":91,"stem":92,"icon":93},"Functions","\u002Ffundamentals\u002Ffunctions","2.fundamentals\u002F5.functions","i-lucide-braces",{"title":95,"path":96,"stem":97,"icon":98},"Control Statements","\u002Ffundamentals\u002Fcontrol-statements","2.fundamentals\u002F6.control-statements","i-lucide-git-branch",{"title":100,"path":101,"stem":102,"icon":103},"Pointers","\u002Ffundamentals\u002Fpointers","2.fundamentals\u002F7.pointers","i-lucide-mouse-pointer-2",{"title":105,"path":106,"stem":107,"icon":108},"Arrays and Slices","\u002Ffundamentals\u002Farrays-and-slices","2.fundamentals\u002F8.arrays-and-slices","i-lucide-list",{"title":110,"path":111,"stem":112,"icon":113},"Maps","\u002Ffundamentals\u002Fmaps","2.fundamentals\u002F9.maps","i-lucide-table-properties",{"title":115,"path":116,"stem":117,"children":118,"page":6},"Concurrency","\u002Fconcurrency","3.concurrency",[119,124,129,134,139],{"title":120,"path":121,"stem":122,"icon":123},"Concurrency Model","\u002Fconcurrency\u002Fconcurrency-model","3.concurrency\u002F1.concurrency-model","i-lucide-network",{"title":125,"path":126,"stem":127,"icon":128},"Goroutines","\u002Fconcurrency\u002Fgoroutines","3.concurrency\u002F2.goroutines","i-lucide-git-fork",{"title":130,"path":131,"stem":132,"icon":133},"Channels","\u002Fconcurrency\u002Fchannels","3.concurrency\u002F3.channels","i-lucide-arrow-left-right",{"title":135,"path":136,"stem":137,"icon":138},"Select and Cancellation","\u002Fconcurrency\u002Fselect-and-cancellation","3.concurrency\u002F4.select-and-cancellation","i-lucide-circle-stop",{"title":140,"path":141,"stem":142,"icon":143},"Synchronization","\u002Fconcurrency\u002Fsynchronization","3.concurrency\u002F5.synchronization","i-lucide-lock-keyhole",{"title":145,"path":146,"stem":147,"children":148,"page":6},"Standard Library","\u002Fstandard-library","4.standard-library",[149,154,159,164,169,174,179],{"title":150,"path":151,"stem":152,"icon":153},"Standard Library Overview","\u002Fstandard-library\u002Foverview","4.standard-library\u002F1.overview","i-lucide-library",{"title":155,"path":156,"stem":157,"icon":158},"Text and Formatting","\u002Fstandard-library\u002Ftext-and-formatting","4.standard-library\u002F2.text-and-formatting","i-lucide-text",{"title":160,"path":161,"stem":162,"icon":163},"Files and JSON","\u002Fstandard-library\u002Ffiles-and-json","4.standard-library\u002F3.files-and-json","i-lucide-file-json",{"title":165,"path":166,"stem":167,"icon":168},"HTTP Clients and Servers","\u002Fstandard-library\u002Fhttp","4.standard-library\u002F4.http","i-lucide-server",{"title":170,"path":171,"stem":172,"icon":173},"Testing","\u002Fstandard-library\u002Ftesting","4.standard-library\u002F5.testing","i-lucide-flask-conical",{"title":175,"path":176,"stem":177,"icon":178},"Command-Line Tools and Configuration","\u002Fstandard-library\u002Fcommand-line-and-configuration","4.standard-library\u002F6.command-line-and-configuration","i-lucide-terminal-square",{"title":180,"path":181,"stem":182,"icon":183},"Structured Logging","\u002Fstandard-library\u002Fstructured-logging","4.standard-library\u002F7.structured-logging","i-lucide-scroll-text",{"title":185,"path":186,"stem":187,"children":188,"page":6},"Backend Development","\u002Fbackend-development","5.backend-development",[189,194,199,204,209,214,219,224,229,234,239],{"title":190,"path":191,"stem":192,"icon":193},"Backend Roadmap","\u002Fbackend-development\u002Fbackend-roadmap","5.backend-development\u002F1.backend-roadmap","i-lucide-route",{"title":195,"path":196,"stem":197,"icon":198},"Graceful Shutdown","\u002Fbackend-development\u002Fgraceful-shutdown","5.backend-development\u002F10.graceful-shutdown","i-lucide-power",{"title":200,"path":201,"stem":202,"icon":203},"Production Checklist","\u002Fbackend-development\u002Fproduction-checklist","5.backend-development\u002F11.production-checklist","i-lucide-clipboard-check",{"title":205,"path":206,"stem":207,"icon":208},"HTTP API Design","\u002Fbackend-development\u002Fhttp-api-design","5.backend-development\u002F2.http-api-design","i-lucide-waypoints",{"title":210,"path":211,"stem":212,"icon":213},"Middleware","\u002Fbackend-development\u002Fmiddleware","5.backend-development\u002F3.middleware","i-lucide-layers-3",{"title":215,"path":216,"stem":217,"icon":218},"Validation","\u002Fbackend-development\u002Fvalidation","5.backend-development\u002F4.validation","i-lucide-list-checks",{"title":220,"path":221,"stem":222,"icon":223},"Application Wiring","\u002Fbackend-development\u002Fapplication-wiring","5.backend-development\u002F5.application-wiring","i-lucide-cable",{"title":225,"path":226,"stem":227,"icon":228},"Observability","\u002Fbackend-development\u002Fobservability","5.backend-development\u002F6.observability","i-lucide-activity",{"title":230,"path":231,"stem":232,"icon":233},"Database SQL","\u002Fbackend-development\u002Fdatabase-sql","5.backend-development\u002F7.database-sql","i-lucide-database",{"title":235,"path":236,"stem":237,"icon":238},"Transactions","\u002Fbackend-development\u002Ftransactions","5.backend-development\u002F8.transactions","i-lucide-repeat-2",{"title":240,"path":241,"stem":242,"icon":243},"Authentication and Authorization","\u002Fbackend-development\u002Fauthentication","5.backend-development\u002F9.authentication","i-lucide-shield-check",{"title":245,"path":246,"stem":247,"children":248,"page":6},"Advanced Go","\u002Fadvanced-go","6.advanced-go",[249,254,259,264,269,274,278,283,288],{"title":250,"path":251,"stem":252,"icon":253},"Advanced Go Roadmap","\u002Fadvanced-go\u002Fadvanced-roadmap","6.advanced-go\u002F1.advanced-roadmap","i-lucide-brain-circuit",{"title":255,"path":256,"stem":257,"icon":258},"Reflection","\u002Fadvanced-go\u002Freflection","6.advanced-go\u002F2.reflection","i-lucide-scan-search",{"title":260,"path":261,"stem":262,"icon":263},"Memory and Garbage Collection","\u002Fadvanced-go\u002Fmemory-and-garbage-collection","6.advanced-go\u002F3.memory-and-garbage-collection","i-lucide-memory-stick",{"title":265,"path":266,"stem":267,"icon":268},"Benchmarking and Profiling","\u002Fadvanced-go\u002Fbenchmarking-and-profiling","6.advanced-go\u002F4.benchmarking-and-profiling","i-lucide-gauge",{"title":270,"path":271,"stem":272,"icon":273},"Advanced Testing and Fuzzing","\u002Fadvanced-go\u002Fadvanced-testing-and-fuzzing","6.advanced-go\u002F5.advanced-testing-and-fuzzing","i-lucide-microscope",{"title":275,"path":276,"stem":277,"icon":48},"Advanced Concurrency","\u002Fadvanced-go\u002Fadvanced-concurrency","6.advanced-go\u002F6.advanced-concurrency",{"title":279,"path":280,"stem":281,"icon":282},"Unsafe and C Boundaries","\u002Fadvanced-go\u002Funsafe-and-cgo","6.advanced-go\u002F7.unsafe-and-cgo","i-lucide-radiation",{"title":284,"path":285,"stem":286,"icon":287},"Package and API Design","\u002Fadvanced-go\u002Fpackage-and-api-design","6.advanced-go\u002F8.package-and-api-design","i-lucide-boxes",{"title":289,"path":290,"stem":291,"icon":292},"Distributed Reliability","\u002Fadvanced-go\u002Fdistributed-reliability","6.advanced-go\u002F9.distributed-reliability","i-lucide-cloud-cog",{"title":294,"path":295,"stem":296,"children":297,"page":6},"Projects","\u002Fprojects","7.projects",[298,316,332,347],{"title":299,"path":300,"stem":301,"children":302,"icon":305},"CLI Task Manager","\u002Fprojects\u002Fcli-task-manager","7.projects\u002F1.cli-task-manager\u002Findex",[303,306,311],{"title":304,"path":300,"stem":301,"icon":305},"Project — CLI Task Manager","i-lucide-list-todo",{"title":307,"path":308,"stem":309,"icon":310},"CLI — Domain and Storage","\u002Fprojects\u002Fcli-task-manager\u002Fdomain-and-storage","7.projects\u002F1.cli-task-manager\u002F1.domain-and-storage","i-lucide-save",{"title":312,"path":313,"stem":314,"icon":315},"CLI — Commands and Tests","\u002Fprojects\u002Fcli-task-manager\u002Fcommands-and-tests","7.projects\u002F1.cli-task-manager\u002F2.commands-and-tests","i-lucide-terminal",{"title":317,"path":318,"stem":319,"children":320,"icon":323},"Concurrent URL Checker","\u002Fprojects\u002Fconcurrent-url-checker","7.projects\u002F2.concurrent-url-checker\u002Findex",[321,324,328],{"title":322,"path":318,"stem":319,"icon":323},"Project — Concurrent URL Checker","i-lucide-radar",{"title":325,"path":326,"stem":327,"icon":128},"URL Checker — Worker Pipeline","\u002Fprojects\u002Fconcurrent-url-checker\u002Fworker-pipeline","7.projects\u002F2.concurrent-url-checker\u002F1.worker-pipeline",{"title":329,"path":330,"stem":331,"icon":173},"URL Checker — Cancellation and Tests","\u002Fprojects\u002Fconcurrent-url-checker\u002Fcancellation-and-tests","7.projects\u002F2.concurrent-url-checker\u002F2.cancellation-and-tests",{"title":333,"path":334,"stem":335,"children":336},"File-backed API","\u002Fprojects\u002Ffile-backed-api","7.projects\u002F3.file-backed-api\u002Findex",[337,339,343],{"title":338,"path":334,"stem":335},"File-backed notes API",{"title":340,"path":341,"stem":342},"File store and concurrency","\u002Fprojects\u002Ffile-backed-api\u002Ffile-store-and-concurrency","7.projects\u002F3.file-backed-api\u002F1.file-store-and-concurrency",{"title":344,"path":345,"stem":346},"HTTP layer and tests","\u002Fprojects\u002Ffile-backed-api\u002Fhttp-and-tests","7.projects\u002F3.file-backed-api\u002F2.http-and-tests",{"title":348,"path":349,"stem":350,"children":351},"Production REST API","\u002Fprojects\u002Fproduction-rest-api","7.projects\u002F4.production-rest-api\u002Findex",[352,354,358],{"title":353,"path":349,"stem":350},"Production REST API capstone",{"title":355,"path":356,"stem":357},"Persistence and authentication","\u002Fprojects\u002Fproduction-rest-api\u002Fpersistence-and-auth","7.projects\u002F4.production-rest-api\u002F1.persistence-and-auth",{"title":359,"path":360,"stem":361},"Operations and release","\u002Fprojects\u002Fproduction-rest-api\u002Foperations-and-release","7.projects\u002F4.production-rest-api\u002F2.operations-and-release",{"title":363,"path":364,"stem":365,"children":366,"page":6},"Meta","\u002Fmeta","99.meta",[367,372],{"title":368,"path":369,"stem":370,"icon":371},"About","\u002Fmeta\u002Fabout","99.meta\u002F1.about","i-lucide-info",{"title":373,"path":374,"stem":375,"icon":376},"Acknowledgements","\u002Fmeta\u002Facknowledgements","99.meta\u002F2.acknowledgements","i-lucide-heart-handshake",{"id":378,"title":265,"body":379,"description":1871,"extension":1872,"links":1873,"meta":1874,"navigation":1875,"path":266,"seo":1876,"stem":267,"__hash__":1878},"docs\u002F6.advanced-go\u002F4.benchmarking-and-profiling.md",{"type":380,"value":381,"toc":1856},"minimark",[382,388,393,397,421,425,428,445,448,452,661,672,680,684,687,992,995,999,1002,1048,1059,1062,1066,1147,1150,1154,1198,1216,1223,1227,1242,1245,1248,1252,1255,1289,1292,1296,1299,1302,1306,1348,1352,1363,1809,1813,1830,1846,1849,1852],[383,384],"learning-lesson-meta",{"level":385,"prerequisites":386,"time":387},"Advanced","Testing, memory concepts, HTTP services, and basic statistics","75–90 minutes",[389,390,392],"h2",{"id":391},"what-you-will-learn","What you will learn",[394,395,396],"p",{},"By the end of this lesson, you will be able to:",[398,399,400,404,407,410,418],"ul",{},[401,402,403],"li",{},"write a benchmark that measures the intended operation;",[401,405,406],{},"report allocations and compare distributions rather than one run;",[401,408,409],{},"choose CPU, heap, block, mutex, or execution-trace evidence;",[401,411,412,413,417],{},"use ",[414,415,416],"code",{},"pprof"," to move from a symptom to relevant code;",[401,419,420],{},"decide whether profile-guided optimisation is worth evaluating.",[389,422,424],{"id":423},"begin-with-a-user-visible-problem","Begin with a user-visible problem",[394,426,427],{},"“This function allocates” is not automatically a problem. A useful performance investigation starts with an outcome:",[398,429,430,433,436,439,442],{},[401,431,432],{},"requests exceed a latency objective;",[401,434,435],{},"throughput is insufficient under expected concurrency;",[401,437,438],{},"memory growth approaches a resource limit;",[401,440,441],{},"CPU cost makes the service too expensive;",[401,443,444],{},"lock or queue contention causes unstable tail latency.",[394,446,447],{},"Record a baseline before changing code.",[389,449,451],{"id":450},"write-a-focused-benchmark","Write a focused benchmark",[453,454,459],"pre",{"className":455,"code":456,"language":457,"meta":458,"style":458},"language-go shiki shiki-themes solarized-light material-theme one-dark-pro","func BenchmarkParseLessonID(b *testing.B) {\n    input := \"lesson-123456\"\n    b.ReportAllocs()\n\n    for b.Loop() {\n        result, err := ParseLessonID(input)\n        if err != nil {\n            b.Fatal(err)\n        }\n        runtime.KeepAlive(result)\n    }\n}\n","go","",[414,460,461,501,523,537,544,564,589,607,625,631,649,655],{"__ignoreMap":458},[462,463,466,470,474,478,482,485,489,492,495,498],"span",{"class":464,"line":465},"line",1,[462,467,469],{"class":468},"sEOdo","func",[462,471,473],{"class":472},"sisdC"," BenchmarkParseLessonID",[462,475,477],{"class":476},"shFME","(",[462,479,481],{"class":480},"syre3","b",[462,483,484],{"class":468}," *",[462,486,488],{"class":487},"snwKR","testing",[462,490,491],{"class":476},".",[462,493,494],{"class":487},"B",[462,496,497],{"class":476},")",[462,499,500],{"class":476}," {\n",[462,502,504,508,512,516,520],{"class":464,"line":503},2,[462,505,507],{"class":506},"s45-6","    input",[462,509,511],{"class":510},"su2KV"," :=",[462,513,515],{"class":514},"sED5a"," \"",[462,517,519],{"class":518},"sVazx","lesson-123456",[462,521,522],{"class":514},"\"\n",[462,524,526,529,531,534],{"class":464,"line":525},3,[462,527,528],{"class":506},"    b",[462,530,491],{"class":476},[462,532,533],{"class":472},"ReportAllocs",[462,535,536],{"class":476},"()\n",[462,538,540],{"class":464,"line":539},4,[462,541,543],{"emptyLinePlaceholder":542},true,"\n",[462,545,547,551,554,556,559,562],{"class":464,"line":546},5,[462,548,550],{"class":549},"s7Bcg","    for",[462,552,553],{"class":506}," b",[462,555,491],{"class":476},[462,557,558],{"class":472},"Loop",[462,560,561],{"class":476},"()",[462,563,500],{"class":476},[462,565,567,570,573,576,578,581,583,586],{"class":464,"line":566},6,[462,568,569],{"class":506},"        result",[462,571,572],{"class":476},",",[462,574,575],{"class":506}," err",[462,577,511],{"class":510},[462,579,580],{"class":472}," ParseLessonID",[462,582,477],{"class":476},[462,584,585],{"class":506},"input",[462,587,588],{"class":476},")\n",[462,590,592,595,597,601,605],{"class":464,"line":591},7,[462,593,594],{"class":549},"        if",[462,596,575],{"class":506},[462,598,600],{"class":599},"sRBoR"," !=",[462,602,604],{"class":603},"sp8Z5"," nil",[462,606,500],{"class":476},[462,608,610,613,615,618,620,623],{"class":464,"line":609},8,[462,611,612],{"class":506},"            b",[462,614,491],{"class":476},[462,616,617],{"class":472},"Fatal",[462,619,477],{"class":476},[462,621,622],{"class":506},"err",[462,624,588],{"class":476},[462,626,628],{"class":464,"line":627},9,[462,629,630],{"class":476},"        }\n",[462,632,634,637,639,642,644,647],{"class":464,"line":633},10,[462,635,636],{"class":506},"        runtime",[462,638,491],{"class":476},[462,640,641],{"class":472},"KeepAlive",[462,643,477],{"class":476},[462,645,646],{"class":506},"result",[462,648,588],{"class":476},[462,650,652],{"class":464,"line":651},11,[462,653,654],{"class":476},"    }\n",[462,656,658],{"class":464,"line":657},12,[462,659,660],{"class":476},"}\n",[394,662,663,664,667,668,671],{},"The benchmark setup occurs outside the measured loop. ",[414,665,666],{},"b.Loop"," controls repeated execution in current Go toolchains. For code targeting older toolchains, use the documented ",[414,669,670],{},"for i := 0; i \u003C b.N; i++"," pattern.",[394,673,674,676,677,679],{},[414,675,533],{}," reports allocation statistics. ",[414,678,641],{}," can make the intended lifetime explicit; design benchmarks so the compiler cannot remove the work as unused.",[389,681,683],{"id":682},"include-realistic-cases","Include realistic cases",[394,685,686],{},"Use sub-benchmarks for meaningful dimensions:",[453,688,690],{"className":455,"code":689,"language":457,"meta":458,"style":458},"func BenchmarkDecodeLesson(b *testing.B) {\n    cases := map[string][]byte{\n        \"small\": []byte(`{\"title\":\"Slices\"}`),\n        \"large\": makeLargeLessonJSON(),\n    }\n\n    for name, input := range cases {\n        b.Run(name, func(b *testing.B) {\n            b.SetBytes(int64(len(input)))\n            for b.Loop() {\n                var lesson Lesson\n                if err := json.Unmarshal(input, &lesson); err != nil {\n                    b.Fatal(err)\n                }\n            }\n        })\n    }\n}\n",[414,691,692,715,741,773,790,794,798,820,856,882,897,908,948,964,970,976,982,987],{"__ignoreMap":458},[462,693,694,696,699,701,703,705,707,709,711,713],{"class":464,"line":465},[462,695,469],{"class":468},[462,697,698],{"class":472}," BenchmarkDecodeLesson",[462,700,477],{"class":476},[462,702,481],{"class":480},[462,704,484],{"class":468},[462,706,488],{"class":487},[462,708,491],{"class":476},[462,710,494],{"class":487},[462,712,497],{"class":476},[462,714,500],{"class":476},[462,716,717,720,722,725,728,732,735,738],{"class":464,"line":503},[462,718,719],{"class":506},"    cases",[462,721,511],{"class":510},[462,723,724],{"class":468}," map",[462,726,727],{"class":476},"[",[462,729,731],{"class":730},"sF6sA","string",[462,733,734],{"class":476},"][]",[462,736,737],{"class":730},"byte",[462,739,740],{"class":476},"{\n",[462,742,743,746,749,752,755,758,760,762,765,768,770],{"class":464,"line":525},[462,744,745],{"class":514},"        \"",[462,747,748],{"class":518},"small",[462,750,751],{"class":514},"\"",[462,753,754],{"class":476},":",[462,756,757],{"class":476}," []",[462,759,737],{"class":730},[462,761,477],{"class":476},[462,763,764],{"class":514},"`",[462,766,767],{"class":518},"{\"title\":\"Slices\"}",[462,769,764],{"class":514},[462,771,772],{"class":476},"),\n",[462,774,775,777,780,782,784,787],{"class":464,"line":539},[462,776,745],{"class":514},[462,778,779],{"class":518},"large",[462,781,751],{"class":514},[462,783,754],{"class":476},[462,785,786],{"class":472}," makeLargeLessonJSON",[462,788,789],{"class":476},"(),\n",[462,791,792],{"class":464,"line":546},[462,793,654],{"class":476},[462,795,796],{"class":464,"line":566},[462,797,543],{"emptyLinePlaceholder":542},[462,799,800,802,805,807,810,812,815,818],{"class":464,"line":591},[462,801,550],{"class":549},[462,803,804],{"class":506}," name",[462,806,572],{"class":476},[462,808,809],{"class":506}," input",[462,811,511],{"class":510},[462,813,814],{"class":549}," range",[462,816,817],{"class":506}," cases",[462,819,500],{"class":476},[462,821,822,825,827,830,832,835,837,840,842,844,846,848,850,852,854],{"class":464,"line":609},[462,823,824],{"class":506},"        b",[462,826,491],{"class":476},[462,828,829],{"class":472},"Run",[462,831,477],{"class":476},[462,833,834],{"class":506},"name",[462,836,572],{"class":476},[462,838,839],{"class":468}," func",[462,841,477],{"class":476},[462,843,481],{"class":480},[462,845,484],{"class":468},[462,847,488],{"class":487},[462,849,491],{"class":476},[462,851,494],{"class":487},[462,853,497],{"class":476},[462,855,500],{"class":476},[462,857,858,860,862,865,867,870,872,875,877,879],{"class":464,"line":627},[462,859,612],{"class":506},[462,861,491],{"class":476},[462,863,864],{"class":472},"SetBytes",[462,866,477],{"class":476},[462,868,869],{"class":730},"int64",[462,871,477],{"class":476},[462,873,874],{"class":472},"len",[462,876,477],{"class":476},[462,878,585],{"class":506},[462,880,881],{"class":476},")))\n",[462,883,884,887,889,891,893,895],{"class":464,"line":633},[462,885,886],{"class":549},"            for",[462,888,553],{"class":506},[462,890,491],{"class":476},[462,892,558],{"class":472},[462,894,561],{"class":476},[462,896,500],{"class":476},[462,898,899,902,905],{"class":464,"line":651},[462,900,901],{"class":468},"                var",[462,903,904],{"class":506}," lesson",[462,906,907],{"class":487}," Lesson\n",[462,909,910,913,915,917,920,922,925,927,929,931,934,937,940,942,944,946],{"class":464,"line":657},[462,911,912],{"class":549},"                if",[462,914,575],{"class":506},[462,916,511],{"class":510},[462,918,919],{"class":506}," json",[462,921,491],{"class":476},[462,923,924],{"class":472},"Unmarshal",[462,926,477],{"class":476},[462,928,585],{"class":506},[462,930,572],{"class":476},[462,932,933],{"class":468}," &",[462,935,936],{"class":506},"lesson",[462,938,939],{"class":476},");",[462,941,575],{"class":506},[462,943,600],{"class":599},[462,945,604],{"class":603},[462,947,500],{"class":476},[462,949,951,954,956,958,960,962],{"class":464,"line":950},13,[462,952,953],{"class":506},"                    b",[462,955,491],{"class":476},[462,957,617],{"class":472},[462,959,477],{"class":476},[462,961,622],{"class":506},[462,963,588],{"class":476},[462,965,967],{"class":464,"line":966},14,[462,968,969],{"class":476},"                }\n",[462,971,973],{"class":464,"line":972},15,[462,974,975],{"class":476},"            }\n",[462,977,979],{"class":464,"line":978},16,[462,980,981],{"class":476},"        })\n",[462,983,985],{"class":464,"line":984},17,[462,986,654],{"class":476},[462,988,990],{"class":464,"line":989},18,[462,991,660],{"class":476},[394,993,994],{},"Microbenchmarks isolate code but can miss cache, network, database, scheduler, and end-to-end effects. Use load tests and production-like profiles for system decisions.",[389,996,998],{"id":997},"compare-statistically","Compare statistically",[394,1000,1001],{},"Run several samples:",[453,1003,1007],{"className":1004,"code":1005,"language":1006,"meta":458,"style":458},"language-bash shiki shiki-themes solarized-light material-theme one-dark-pro","go test -run='^$' -bench=BenchmarkParseLessonID -benchmem -count=10 .\u002Finternal\u002Flesson > before.txt\n","bash",[414,1008,1009],{"__ignoreMap":458},[462,1010,1011,1014,1017,1021,1024,1027,1029,1032,1035,1038,1041,1045],{"class":464,"line":465},[462,1012,457],{"class":1013},"sqRHY",[462,1015,1016],{"class":518}," test",[462,1018,1020],{"class":1019},"s2SA0"," -run=",[462,1022,1023],{"class":514},"'",[462,1025,1026],{"class":518},"^$",[462,1028,1023],{"class":514},[462,1030,1031],{"class":1019}," -bench=BenchmarkParseLessonID",[462,1033,1034],{"class":1019}," -benchmem",[462,1036,1037],{"class":1019}," -count=10",[462,1039,1040],{"class":518}," .\u002Finternal\u002Flesson",[462,1042,1044],{"class":1043},"sN42N"," >",[462,1046,1047],{"class":518}," before.txt\n",[394,1049,1050,1051,1054,1055,1058],{},"Repeat after the change into ",[414,1052,1053],{},"after.txt"," and compare with a suitable statistical tool such as ",[414,1056,1057],{},"benchstat"," from the Go performance tools. Keep machine load, toolchain, power settings, and inputs as consistent as practical.",[394,1060,1061],{},"Tiny differences can be noise. Look for a meaningful effect tied to the actual objective.",[389,1063,1065],{"id":1064},"choose-the-right-profile","Choose the right profile",[1067,1068,1069,1082],"table",{},[1070,1071,1072],"thead",{},[1073,1074,1075,1079],"tr",{},[1076,1077,1078],"th",{},"Evidence",[1076,1080,1081],{},"Question",[1083,1084,1085,1094,1105,1115,1123,1131,1139],"tbody",{},[1073,1086,1087,1091],{},[1088,1089,1090],"td",{},"CPU profile",[1088,1092,1093],{},"Where is sampled CPU time spent?",[1073,1095,1096,1102],{},[1088,1097,1098,1099],{},"Heap ",[414,1100,1101],{},"inuse_space",[1088,1103,1104],{},"What currently retains heap memory?",[1073,1106,1107,1112],{},[1088,1108,1098,1109],{},[414,1110,1111],{},"alloc_space",[1088,1113,1114],{},"Where have allocations accumulated over time?",[1073,1116,1117,1120],{},[1088,1118,1119],{},"Block profile",[1088,1121,1122],{},"Where do goroutines wait on synchronization?",[1073,1124,1125,1128],{},[1088,1126,1127],{},"Mutex profile",[1088,1129,1130],{},"Where is lock contention observed?",[1073,1132,1133,1136],{},[1088,1134,1135],{},"Goroutine profile",[1088,1137,1138],{},"What stacks and wait states exist now?",[1073,1140,1141,1144],{},[1088,1142,1143],{},"Execution trace",[1088,1145,1146],{},"How do goroutines, scheduling, GC, and blocking interact over time?",[394,1148,1149],{},"Profiles are sampled evidence. Interpret them in the context of the workload and collection window.",[389,1151,1153],{"id":1152},"profile-a-test-or-benchmark","Profile a test or benchmark",[453,1155,1157],{"className":1004,"code":1156,"language":1006,"meta":458,"style":458},"go test -run='^$' -bench=BenchmarkWork -cpuprofile=cpu.out -memprofile=mem.out .\u002Finternal\u002Fwork\ngo tool pprof cpu.out\n",[414,1158,1159,1185],{"__ignoreMap":458},[462,1160,1161,1163,1165,1167,1169,1171,1173,1176,1179,1182],{"class":464,"line":465},[462,1162,457],{"class":1013},[462,1164,1016],{"class":518},[462,1166,1020],{"class":1019},[462,1168,1023],{"class":514},[462,1170,1026],{"class":518},[462,1172,1023],{"class":514},[462,1174,1175],{"class":1019}," -bench=BenchmarkWork",[462,1177,1178],{"class":1019}," -cpuprofile=cpu.out",[462,1180,1181],{"class":1019}," -memprofile=mem.out",[462,1183,1184],{"class":518}," .\u002Finternal\u002Fwork\n",[462,1186,1187,1189,1192,1195],{"class":464,"line":503},[462,1188,457],{"class":1013},[462,1190,1191],{"class":518}," tool",[462,1193,1194],{"class":518}," pprof",[462,1196,1197],{"class":518}," cpu.out\n",[394,1199,1200,1201,1204,1205,1204,1208,1211,1212,1215],{},"Useful interactive commands include ",[414,1202,1203],{},"top",", ",[414,1206,1207],{},"top -cum",[414,1209,1210],{},"list FunctionName",", and ",[414,1213,1214],{},"web"," when graph dependencies are available.",[394,1217,1218,1219,1222],{},"For a service, ",[414,1220,1221],{},"net\u002Fhttp\u002Fpprof"," can expose runtime profiles on an HTTP server. Protect that listener and avoid exposing it publicly.",[389,1224,1226],{"id":1225},"read-flat-and-cumulative-cost","Read flat and cumulative cost",[398,1228,1229,1236],{},[401,1230,1231,1235],{},[1232,1233,1234],"strong",{},"Flat"," cost is attributed directly to a function.",[401,1237,1238,1241],{},[1232,1239,1240],{},"Cumulative"," cost includes work performed by functions it calls.",[394,1243,1244],{},"A coordinator may have low flat cost but high cumulative cost. A low-level operation may have high flat cost across many callers.",[394,1246,1247],{},"Follow the call path and inspect source lines before deciding what to change.",[389,1249,1251],{"id":1250},"execution-traces","Execution traces",[394,1253,1254],{},"Use a trace when the problem involves latency, scheduling, goroutine states, network blocking, or garbage collection interaction:",[453,1256,1258],{"className":1004,"code":1257,"language":1006,"meta":458,"style":458},"go test -run TestScenario -trace=trace.out .\u002Finternal\u002Fwork\ngo tool trace trace.out\n",[414,1259,1260,1277],{"__ignoreMap":458},[462,1261,1262,1264,1266,1269,1272,1275],{"class":464,"line":465},[462,1263,457],{"class":1013},[462,1265,1016],{"class":518},[462,1267,1268],{"class":1019}," -run",[462,1270,1271],{"class":518}," TestScenario",[462,1273,1274],{"class":1019}," -trace=trace.out",[462,1276,1184],{"class":518},[462,1278,1279,1281,1283,1286],{"class":464,"line":503},[462,1280,457],{"class":1013},[462,1282,1191],{"class":518},[462,1284,1285],{"class":518}," trace",[462,1287,1288],{"class":518}," trace.out\n",[394,1290,1291],{},"Traces can be large and add overhead. Capture the shortest representative window that contains the problem.",[389,1293,1295],{"id":1294},"profile-guided-optimisation","Profile-guided optimisation",[394,1297,1298],{},"Go supports using representative CPU profiles to guide compiler optimisation. PGO can improve some workloads without source changes, but gains vary.",[394,1300,1301],{},"Use a representative, recent profile; verify correctness; compare performance and binary behaviour; and keep a reproducible process for refreshing or removing the profile. Treat PGO as the final part of an evidence loop, not a substitute for fixing inefficient algorithms.",[389,1303,1305],{"id":1304},"common-mistakes","Common mistakes",[398,1307,1308,1314,1320,1326,1332,1342],{},[401,1309,1310,1313],{},[1232,1311,1312],{},"Benchmarking setup inside the loop:"," parsing or allocation unrelated to the target dominates the result.",[401,1315,1316,1319],{},[1232,1317,1318],{},"Comparing one run:"," scheduler and machine noise look like an improvement.",[401,1321,1322,1325],{},[1232,1323,1324],{},"Using unrealistic tiny input:"," algorithmic behaviour at real sizes remains invisible.",[401,1327,1328,1331],{},[1232,1329,1330],{},"Optimising the hottest function without understanding why it is called:"," the better fix may remove calls higher in the stack.",[401,1333,1334,1341],{},[1232,1335,1336,1337,1340],{},"Reading ",[414,1338,1339],{},"allocs\u002Fop"," without retention evidence:"," allocation rate and live memory are different questions.",[401,1343,1344,1347],{},[1232,1345,1346],{},"Shipping a stale or unrepresentative PGO profile:"," compiler choices target the wrong workload.",[389,1349,1351],{"id":1350},"practice","Practice",[394,1353,1354,1355,1358,1359,1362],{},"Create two implementations that build a comma-separated string: repeated ",[414,1356,1357],{},"+"," concatenation and ",[414,1360,1361],{},"strings.Builder",". Benchmark small and large inputs, report allocations, collect a CPU profile for the larger case, and write a conclusion limited to the measured conditions.",[1364,1365,1366],"accordion",{},[1367,1368,1371,1806],"accordion-item",{"icon":1369,"label":1370},"i-lucide-lightbulb","Show benchmark outline",[453,1372,1374],{"className":455,"code":1373,"language":457,"meta":458,"style":458},"func concatenate(values []string) string {\n    var result string\n    for index, value := range values {\n        if index > 0 {\n            result += \",\"\n        }\n        result += value\n    }\n    return result\n}\n\nfunc build(values []string) string {\n    var builder strings.Builder\n    for index, value := range values {\n        if index > 0 {\n            builder.WriteByte(',')\n        }\n        builder.WriteString(value)\n    }\n    return builder.String()\n}\n\nfunc benchmarkJoin(b *testing.B, size int, function func([]string) string) {\n    values := make([]string, size)\n    for index := range values {\n        values[index] = \"lesson\"\n    }\n    b.ReportAllocs()\n    for b.Loop() {\n        result := function(values)\n        runtime.KeepAlive(result)\n    }\n}\n",[414,1375,1376,1399,1410,1431,1445,1459,1463,1472,1476,1484,1488,1492,1513,1528,1546,1558,1578,1582,1599,1604,1618,1623,1628,1676,1697,1712,1735,1740,1751,1766,1781,1796,1801],{"__ignoreMap":458},[462,1377,1378,1380,1383,1385,1388,1390,1392,1394,1397],{"class":464,"line":465},[462,1379,469],{"class":468},[462,1381,1382],{"class":472}," concatenate",[462,1384,477],{"class":476},[462,1386,1387],{"class":480},"values",[462,1389,757],{"class":476},[462,1391,731],{"class":730},[462,1393,497],{"class":476},[462,1395,1396],{"class":730}," string",[462,1398,500],{"class":476},[462,1400,1401,1404,1407],{"class":464,"line":503},[462,1402,1403],{"class":468},"    var",[462,1405,1406],{"class":506}," result",[462,1408,1409],{"class":730}," string\n",[462,1411,1412,1414,1417,1419,1422,1424,1426,1429],{"class":464,"line":525},[462,1413,550],{"class":549},[462,1415,1416],{"class":506}," index",[462,1418,572],{"class":476},[462,1420,1421],{"class":506}," value",[462,1423,511],{"class":510},[462,1425,814],{"class":549},[462,1427,1428],{"class":506}," values",[462,1430,500],{"class":476},[462,1432,1433,1435,1437,1439,1443],{"class":464,"line":539},[462,1434,594],{"class":549},[462,1436,1416],{"class":506},[462,1438,1044],{"class":599},[462,1440,1442],{"class":1441},"sAJzr"," 0",[462,1444,500],{"class":476},[462,1446,1447,1450,1453,1455,1457],{"class":464,"line":546},[462,1448,1449],{"class":506},"            result",[462,1451,1452],{"class":510}," +=",[462,1454,515],{"class":514},[462,1456,572],{"class":518},[462,1458,522],{"class":514},[462,1460,1461],{"class":464,"line":566},[462,1462,630],{"class":476},[462,1464,1465,1467,1469],{"class":464,"line":591},[462,1466,569],{"class":506},[462,1468,1452],{"class":510},[462,1470,1471],{"class":506}," value\n",[462,1473,1474],{"class":464,"line":609},[462,1475,654],{"class":476},[462,1477,1478,1481],{"class":464,"line":627},[462,1479,1480],{"class":549},"    return",[462,1482,1483],{"class":506}," result\n",[462,1485,1486],{"class":464,"line":633},[462,1487,660],{"class":476},[462,1489,1490],{"class":464,"line":651},[462,1491,543],{"emptyLinePlaceholder":542},[462,1493,1494,1496,1499,1501,1503,1505,1507,1509,1511],{"class":464,"line":657},[462,1495,469],{"class":468},[462,1497,1498],{"class":472}," build",[462,1500,477],{"class":476},[462,1502,1387],{"class":480},[462,1504,757],{"class":476},[462,1506,731],{"class":730},[462,1508,497],{"class":476},[462,1510,1396],{"class":730},[462,1512,500],{"class":476},[462,1514,1515,1517,1520,1523,1525],{"class":464,"line":950},[462,1516,1403],{"class":468},[462,1518,1519],{"class":506}," builder",[462,1521,1522],{"class":487}," strings",[462,1524,491],{"class":476},[462,1526,1527],{"class":487},"Builder\n",[462,1529,1530,1532,1534,1536,1538,1540,1542,1544],{"class":464,"line":966},[462,1531,550],{"class":549},[462,1533,1416],{"class":506},[462,1535,572],{"class":476},[462,1537,1421],{"class":506},[462,1539,511],{"class":510},[462,1541,814],{"class":549},[462,1543,1428],{"class":506},[462,1545,500],{"class":476},[462,1547,1548,1550,1552,1554,1556],{"class":464,"line":972},[462,1549,594],{"class":549},[462,1551,1416],{"class":506},[462,1553,1044],{"class":599},[462,1555,1442],{"class":1441},[462,1557,500],{"class":476},[462,1559,1560,1563,1565,1568,1570,1572,1574,1576],{"class":464,"line":978},[462,1561,1562],{"class":506},"            builder",[462,1564,491],{"class":476},[462,1566,1567],{"class":472},"WriteByte",[462,1569,477],{"class":476},[462,1571,1023],{"class":514},[462,1573,572],{"class":1019},[462,1575,1023],{"class":514},[462,1577,588],{"class":476},[462,1579,1580],{"class":464,"line":984},[462,1581,630],{"class":476},[462,1583,1584,1587,1589,1592,1594,1597],{"class":464,"line":989},[462,1585,1586],{"class":506},"        builder",[462,1588,491],{"class":476},[462,1590,1591],{"class":472},"WriteString",[462,1593,477],{"class":476},[462,1595,1596],{"class":506},"value",[462,1598,588],{"class":476},[462,1600,1602],{"class":464,"line":1601},19,[462,1603,654],{"class":476},[462,1605,1607,1609,1611,1613,1616],{"class":464,"line":1606},20,[462,1608,1480],{"class":549},[462,1610,1519],{"class":506},[462,1612,491],{"class":476},[462,1614,1615],{"class":472},"String",[462,1617,536],{"class":476},[462,1619,1621],{"class":464,"line":1620},21,[462,1622,660],{"class":476},[462,1624,1626],{"class":464,"line":1625},22,[462,1627,543],{"emptyLinePlaceholder":542},[462,1629,1631,1633,1636,1638,1640,1642,1644,1646,1648,1650,1653,1656,1658,1661,1663,1666,1668,1670,1672,1674],{"class":464,"line":1630},23,[462,1632,469],{"class":468},[462,1634,1635],{"class":472}," benchmarkJoin",[462,1637,477],{"class":476},[462,1639,481],{"class":480},[462,1641,484],{"class":468},[462,1643,488],{"class":487},[462,1645,491],{"class":476},[462,1647,494],{"class":487},[462,1649,572],{"class":476},[462,1651,1652],{"class":480}," size",[462,1654,1655],{"class":730}," int",[462,1657,572],{"class":476},[462,1659,1660],{"class":480}," function",[462,1662,839],{"class":468},[462,1664,1665],{"class":476},"([]",[462,1667,731],{"class":730},[462,1669,497],{"class":476},[462,1671,1396],{"class":730},[462,1673,497],{"class":476},[462,1675,500],{"class":476},[462,1677,1679,1682,1684,1687,1689,1691,1693,1695],{"class":464,"line":1678},24,[462,1680,1681],{"class":506},"    values",[462,1683,511],{"class":510},[462,1685,1686],{"class":472}," make",[462,1688,1665],{"class":476},[462,1690,731],{"class":730},[462,1692,572],{"class":476},[462,1694,1652],{"class":506},[462,1696,588],{"class":476},[462,1698,1700,1702,1704,1706,1708,1710],{"class":464,"line":1699},25,[462,1701,550],{"class":549},[462,1703,1416],{"class":506},[462,1705,511],{"class":510},[462,1707,814],{"class":549},[462,1709,1428],{"class":506},[462,1711,500],{"class":476},[462,1713,1715,1718,1720,1723,1726,1729,1731,1733],{"class":464,"line":1714},26,[462,1716,1717],{"class":506},"        values",[462,1719,727],{"class":476},[462,1721,1722],{"class":506},"index",[462,1724,1725],{"class":476},"]",[462,1727,1728],{"class":510}," =",[462,1730,515],{"class":514},[462,1732,936],{"class":518},[462,1734,522],{"class":514},[462,1736,1738],{"class":464,"line":1737},27,[462,1739,654],{"class":476},[462,1741,1743,1745,1747,1749],{"class":464,"line":1742},28,[462,1744,528],{"class":506},[462,1746,491],{"class":476},[462,1748,533],{"class":472},[462,1750,536],{"class":476},[462,1752,1754,1756,1758,1760,1762,1764],{"class":464,"line":1753},29,[462,1755,550],{"class":549},[462,1757,553],{"class":506},[462,1759,491],{"class":476},[462,1761,558],{"class":472},[462,1763,561],{"class":476},[462,1765,500],{"class":476},[462,1767,1769,1771,1773,1775,1777,1779],{"class":464,"line":1768},30,[462,1770,569],{"class":506},[462,1772,511],{"class":510},[462,1774,1660],{"class":472},[462,1776,477],{"class":476},[462,1778,1387],{"class":506},[462,1780,588],{"class":476},[462,1782,1784,1786,1788,1790,1792,1794],{"class":464,"line":1783},31,[462,1785,636],{"class":506},[462,1787,491],{"class":476},[462,1789,641],{"class":472},[462,1791,477],{"class":476},[462,1793,646],{"class":506},[462,1795,588],{"class":476},[462,1797,1799],{"class":464,"line":1798},32,[462,1800,654],{"class":476},[462,1802,1804],{"class":464,"line":1803},33,[462,1805,660],{"class":476},[394,1807,1808],{},"Create named benchmarks for both functions at several sizes. Do not publish a universal conclusion from expected intuition; report toolchain, hardware, inputs, sample count, and observed distribution.",[389,1810,1812],{"id":1811},"summary","Summary",[398,1814,1815,1818,1821,1824,1827],{},[401,1816,1817],{},"Start performance work with a user-visible objective and baseline.",[401,1819,1820],{},"Benchmark representative operations and compare repeated samples.",[401,1822,1823],{},"Select profiles based on the question: CPU, retention, allocation, blocking, contention, or scheduling.",[401,1825,1826],{},"Inspect call paths and source before modifying code.",[401,1828,1829],{},"Re-measure after every optimisation and remove complexity that does not help.",[394,1831,1832,1833,1840,1841,491],{},"Official references: ",[1834,1835,1839],"a",{"href":1836,"rel":1837},"https:\u002F\u002Fgo.dev\u002Fdoc\u002Fdiagnostics",[1838],"nofollow","Diagnostics"," and ",[1834,1842,1845],{"href":1843,"rel":1844},"https:\u002F\u002Fgo.dev\u002Fdoc\u002Fpgo",[1838],"Profile-guided optimization",[1847,1848],"learning-lesson-complete",{},[1850,1851],"learning-lesson-navigation",{"next":271,"next-label":270,"previous":261,"previous-label":260},[1853,1854,1855],"style",{},"html pre.shiki code .sEOdo, html code.shiki .sEOdo{--shiki-light:#859900;--shiki-default:#89DDFF;--shiki-dark:#C678DD}html pre.shiki code .sisdC, html code.shiki .sisdC{--shiki-light:#268BD2;--shiki-default:#82AAFF;--shiki-dark:#61AFEF}html pre.shiki code .shFME, html code.shiki .shFME{--shiki-light:#657B83;--shiki-default:#89DDFF;--shiki-dark:#ABB2BF}html pre.shiki code .syre3, html code.shiki .syre3{--shiki-light:#657B83;--shiki-light-font-style:inherit;--shiki-default:#EEFFFF;--shiki-default-font-style:italic;--shiki-dark:#E06C75;--shiki-dark-font-style:italic}html pre.shiki code .snwKR, html code.shiki .snwKR{--shiki-light:#CB4B16;--shiki-default:#FFCB6B;--shiki-dark:#E5C07B}html pre.shiki code .s45-6, html code.shiki .s45-6{--shiki-light:#268BD2;--shiki-default:#EEFFFF;--shiki-dark:#E06C75}html pre.shiki code .su2KV, html code.shiki .su2KV{--shiki-light:#859900;--shiki-default:#89DDFF;--shiki-dark:#E5C07B}html pre.shiki code .sED5a, html code.shiki .sED5a{--shiki-light:#2AA198;--shiki-default:#89DDFF;--shiki-dark:#98C379}html pre.shiki code .sVazx, html code.shiki .sVazx{--shiki-light:#2AA198;--shiki-default:#C3E88D;--shiki-dark:#98C379}html pre.shiki code .s7Bcg, html code.shiki .s7Bcg{--shiki-light:#859900;--shiki-light-font-style:inherit;--shiki-default:#89DDFF;--shiki-default-font-style:italic;--shiki-dark:#C678DD;--shiki-dark-font-style:inherit}html pre.shiki code .sRBoR, html code.shiki .sRBoR{--shiki-light:#859900;--shiki-default:#89DDFF;--shiki-dark:#56B6C2}html pre.shiki code .sp8Z5, html code.shiki .sp8Z5{--shiki-light:#B58900;--shiki-default:#89DDFF;--shiki-dark:#D19A66}html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html pre.shiki code .sF6sA, html code.shiki .sF6sA{--shiki-light:#586E75;--shiki-light-font-weight:bold;--shiki-default:#C792EA;--shiki-default-font-weight:inherit;--shiki-dark:#C678DD;--shiki-dark-font-weight:inherit}html pre.shiki code .sqRHY, html code.shiki .sqRHY{--shiki-light:#268BD2;--shiki-default:#FFCB6B;--shiki-dark:#61AFEF}html pre.shiki code .s2SA0, html code.shiki .s2SA0{--shiki-light:#CB4B16;--shiki-default:#C3E88D;--shiki-dark:#D19A66}html pre.shiki code .sN42N, html code.shiki .sN42N{--shiki-light:#859900;--shiki-default:#89DDFF;--shiki-dark:#ABB2BF}html pre.shiki code .sAJzr, html code.shiki .sAJzr{--shiki-light:#D33682;--shiki-default:#F78C6C;--shiki-dark:#D19A66}",{"title":458,"searchDepth":503,"depth":503,"links":1857},[1858,1859,1860,1861,1862,1863,1864,1865,1866,1867,1868,1869,1870],{"id":391,"depth":503,"text":392},{"id":423,"depth":503,"text":424},{"id":450,"depth":503,"text":451},{"id":682,"depth":503,"text":683},{"id":997,"depth":503,"text":998},{"id":1064,"depth":503,"text":1065},{"id":1152,"depth":503,"text":1153},{"id":1225,"depth":503,"text":1226},{"id":1250,"depth":503,"text":1251},{"id":1294,"depth":503,"text":1295},{"id":1304,"depth":503,"text":1305},{"id":1350,"depth":503,"text":1351},{"id":1811,"depth":503,"text":1812},"Measure representative performance, locate bottlenecks, compare changes, and avoid misleading microbenchmarks.","md",null,{},{"icon":268},{"description":1877,"title":265},"Learn Go benchmarks, allocation reports, CPU and heap profiles, pprof, execution traces, and profile-guided optimization.","QzKQsNTU2FadFRbV115aSECx2bXYfXi0UHB5SQpCODs",[1880,1882],{"title":260,"path":261,"stem":262,"description":1881,"icon":263,"children":-1},"Reason about reachability, escape analysis, allocation, retention, and resource cleanup without relying on myths.",{"title":270,"path":271,"stem":272,"description":1883,"icon":273,"children":-1},"Control dependencies, test properties and boundaries, fuzz parsers, and keep suites deterministic.",1794118103246]