{"id":6290,"date":"2020-05-20T14:02:00","date_gmt":"2020-05-20T14:02:00","guid":{"rendered":"https:\/\/stackify.com\/?p=6290"},"modified":"2023-05-01T17:08:40","modified_gmt":"2023-05-01T17:08:40","slug":"what-is-code-profiling","status":"publish","type":"post","link":"https:\/\/stackify.com\/what-is-code-profiling\/","title":{"rendered":"What is Code Profiling? Learn the 3 Types of Code Profilers"},"content":{"rendered":"<p><span style=\"font-weight: 400;\">At Stackify, we\u2019re all about helping you improve your application\u2019s performance. We have actually developed two code profilers ourselves. Because of that, we like to think we know a thing or two about<\/span><a href=\"https:\/\/stackify.com\/retrace-code-profiling\/\"> <span style=\"font-weight: 400;\">code profiling<\/span><\/a><span style=\"font-weight: 400;\">.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Today I want to talk about the three different types of code profilers, describe the differences between them, and recommend some tools for your toolbox.<\/span><\/p>\n<h3>So, what exactly does code profiling do?<\/h3>\n<p><span style=\"font-weight: 400;\">Typically code profilers are used by developers to help identify performance problems without having to touch their code. Profilers can answer questions like, \u201cHow many times is each method in my code called?\u201d and, \u201cHow long do each of these methods take?\u201d Profilers also track things like memory allocations and garbage collection. Some profilers can even track key methods in your code, so you can understand how often SQL statements and web services are called. In addition, some profilers can track web requests and train those transactions to understand the performance of transactions within your code.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Code profilers can track all the way down to each individual line of code. However, most developers only use profilers when chasing a CPU or memory problem, and need to go out of their way to try and find those problems. This is because many profilers make applications run a hundred times slower than usual. While most consider profilers to be a situational tool not meant for daily use, code profiling can be a total lifesaver when you need it.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Profilers are great for finding the hot path in your code. Figuring out what is using twenty percent of the total CPU usage of your code, and then determining how to improve that would be a great example of when to use a code profiler. In addition, profilers are also great for finding memory leaks early, as well as understanding the performance of dependency calls and transactions. Profilers help you look for methods that can lead to improvement over time. A former mentor once told me, \u201cIf you can improve something one percent every day, then over the course of a month, you&#8217;ll improve by thirty percent.\u201d&nbsp; What really makes a difference is continued improvement over time.<\/span><\/p>\n<h3>Types of code profilers<\/h3>\n<p><span style=\"font-weight: 400;\">There are two different types of code profilers: server-side and desktop. A server-side profiler tracks the performance of key methods in pre-production or production environments. These profilers measure transaction timing, such as tracking how long a web request takes, while also giving you increased visibility into errors and logs. An example of a server-side profiler would be an application performance management tool, or APM, for short.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Desktop code profiling is slower and requires a lot of overhead, potentially making your app much slower than it should be. This kind of profiler usually tracks the performance of every line of code within each individual method. These types of profilers also track memory allocations and garbage collection to help with memory leaks. desktop profilers are very good at finding that hot path, figuring out every single method that&#8217;s being called, and identifying what uses the most CPU.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">But there&#8217;s also another solution. For the sake of simplicity, we\u2019ll call it a hybrid profiler.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">These hybrid code profilers merge key data from server-based profiling with code-level details on your desktop for use every day. These profilers provide server level insights combined with the ability to track key methods, every transaction, dependency calls, errors, and logs.<\/span><\/p>\n<h3>Tools that align to these three different types of profilers<\/h3>\n<p><span style=\"font-weight: 400;\">For server-side code profiling, most companies use APMs. At Stackify we\u2019ve developed a product called<\/span><a href=\"https:\/\/stackify.com\/retrace\"> <span style=\"font-weight: 400;\">Retrace<\/span><\/a><span style=\"font-weight: 400;\">.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Some options for desktop code profilers include Visual Studio, NProfiler, and others.&nbsp;<\/span><\/p>\n<p><span style=\"font-weight: 400;\">There are very few true hybrid code profiling solutions. Among those is our own hybrid profiler we call <\/span><a href=\"https:\/\/stackify.com\/prefix\"><span style=\"font-weight: 400;\">&nbsp;<\/span><span style=\"font-weight: 400;\">Prefix<\/span><\/a><span style=\"font-weight: 400;\">, which is free to use.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">When comparing server-based and hybrid code profilers keep in mind a few things. Many profilers must be built into the code itself. This is what causes most profilers to make applications run slow and is also why they tend to be utilized in specific circumstances.&nbsp;<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Very few profilers, like <\/span><a href=\"https:\/\/stackify.com\/prefix\"><span style=\"font-weight: 400;\">Prefix<\/span><\/a><span style=\"font-weight: 400;\">, are able to collect data from the outside looking in.&nbsp;<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Few APMs can be installed on your server without any changes to the code. Most APMs require code changes and\/or multiple config changes.<\/span><!--e0c5fc4c--><\/p>\n","protected":false},"excerpt":{"rendered":"<p>At Stackify, we\u2019re all about helping you improve your application\u2019s performance. We have actually developed two code profilers ourselves. Because of that, we like to think we know a thing or two about code profiling. Today I want to talk about the three different types of code profilers, describe the differences between them, and recommend [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":36873,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[7],"tags":[52,34],"class_list":["post-6290","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-developers","tag-developer-tips","tag-developer-tools"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v25.6 (Yoast SEO v25.6) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>What is Code Profiling? Learn the 3 Types of Code Profilers - Stackify<\/title>\n<meta name=\"description\" content=\"Learn what code profiling is, the 3 different types of code profilers (server-side, desktop, and hybrid) and how they can benefit your dev team.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/stackify.com\/what-is-code-profiling\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"What is Code Profiling? Learn the 3 Types of Code Profilers - Stackify\" \/>\n<meta property=\"og:description\" content=\"Learn what code profiling is, the 3 different types of code profilers (server-side, desktop, and hybrid) and how they can benefit your dev team.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/stackify.com\/what-is-code-profiling\/\" \/>\n<meta property=\"og:site_name\" content=\"Stackify\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/Stackify\/\" \/>\n<meta property=\"article:published_time\" content=\"2020-05-20T14:02:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-05-01T17:08:40+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/stackify.com\/wp-content\/uploads\/2020\/05\/prefix-code-profiler-881x441-1.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"881\" \/>\n\t<meta property=\"og:image:height\" content=\"441\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Alexandra Altvater\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@stackify\" \/>\n<meta name=\"twitter:site\" content=\"@stackify\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Alexandra Altvater\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/stackify.com\/what-is-code-profiling\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/stackify.com\/what-is-code-profiling\/\"},\"author\":{\"name\":\"Alexandra Altvater\",\"@id\":\"https:\/\/stackify.com\/#\/schema\/person\/3087594560b933be18c662a37d09b51a\"},\"headline\":\"What is Code Profiling? Learn the 3 Types of Code Profilers\",\"datePublished\":\"2020-05-20T14:02:00+00:00\",\"dateModified\":\"2023-05-01T17:08:40+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/stackify.com\/what-is-code-profiling\/\"},\"wordCount\":731,\"publisher\":{\"@id\":\"https:\/\/stackify.com\/#organization\"},\"image\":{\"@id\":\"https:\/\/stackify.com\/what-is-code-profiling\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/stackify.com\/wp-content\/uploads\/2020\/05\/prefix-code-profiler-881x441-1.jpg\",\"keywords\":[\"developer tips\",\"developer tools\"],\"articleSection\":[\"Developer Tips, Tricks &amp; Resources\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/stackify.com\/what-is-code-profiling\/\",\"url\":\"https:\/\/stackify.com\/what-is-code-profiling\/\",\"name\":\"What is Code Profiling? Learn the 3 Types of Code Profilers - Stackify\",\"isPartOf\":{\"@id\":\"https:\/\/stackify.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/stackify.com\/what-is-code-profiling\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/stackify.com\/what-is-code-profiling\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/stackify.com\/wp-content\/uploads\/2020\/05\/prefix-code-profiler-881x441-1.jpg\",\"datePublished\":\"2020-05-20T14:02:00+00:00\",\"dateModified\":\"2023-05-01T17:08:40+00:00\",\"description\":\"Learn what code profiling is, the 3 different types of code profilers (server-side, desktop, and hybrid) and how they can benefit your dev team.\",\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/stackify.com\/what-is-code-profiling\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/stackify.com\/what-is-code-profiling\/#primaryimage\",\"url\":\"https:\/\/stackify.com\/wp-content\/uploads\/2020\/05\/prefix-code-profiler-881x441-1.jpg\",\"contentUrl\":\"https:\/\/stackify.com\/wp-content\/uploads\/2020\/05\/prefix-code-profiler-881x441-1.jpg\",\"width\":881,\"height\":441},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/stackify.com\/#website\",\"url\":\"https:\/\/stackify.com\/\",\"name\":\"Stackify\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/stackify.com\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/stackify.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/stackify.com\/#organization\",\"name\":\"Stackify\",\"url\":\"https:\/\/stackify.com\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/stackify.com\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/stackify.com\/wp-content\/uploads\/2024\/05\/logo-1.png\",\"contentUrl\":\"https:\/\/stackify.com\/wp-content\/uploads\/2024\/05\/logo-1.png\",\"width\":1377,\"height\":430,\"caption\":\"Stackify\"},\"image\":{\"@id\":\"https:\/\/stackify.com\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/Stackify\/\",\"https:\/\/x.com\/stackify\",\"https:\/\/www.instagram.com\/stackify\/\",\"https:\/\/www.linkedin.com\/company\/2596184\",\"https:\/\/www.youtube.com\/stackify\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/stackify.com\/#\/schema\/person\/3087594560b933be18c662a37d09b51a\",\"name\":\"Alexandra Altvater\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/stackify.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/99e0459a6d11f4f510127934dfd98b94?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/99e0459a6d11f4f510127934dfd98b94?s=96&d=mm&r=g\",\"caption\":\"Alexandra Altvater\"}}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"What is Code Profiling? Learn the 3 Types of Code Profilers - Stackify","description":"Learn what code profiling is, the 3 different types of code profilers (server-side, desktop, and hybrid) and how they can benefit your dev team.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/stackify.com\/what-is-code-profiling\/","og_locale":"en_US","og_type":"article","og_title":"What is Code Profiling? Learn the 3 Types of Code Profilers - Stackify","og_description":"Learn what code profiling is, the 3 different types of code profilers (server-side, desktop, and hybrid) and how they can benefit your dev team.","og_url":"https:\/\/stackify.com\/what-is-code-profiling\/","og_site_name":"Stackify","article_publisher":"https:\/\/www.facebook.com\/Stackify\/","article_published_time":"2020-05-20T14:02:00+00:00","article_modified_time":"2023-05-01T17:08:40+00:00","og_image":[{"width":881,"height":441,"url":"https:\/\/stackify.com\/wp-content\/uploads\/2020\/05\/prefix-code-profiler-881x441-1.jpg","type":"image\/jpeg"}],"author":"Alexandra Altvater","twitter_card":"summary_large_image","twitter_creator":"@stackify","twitter_site":"@stackify","twitter_misc":{"Written by":"Alexandra Altvater","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/stackify.com\/what-is-code-profiling\/#article","isPartOf":{"@id":"https:\/\/stackify.com\/what-is-code-profiling\/"},"author":{"name":"Alexandra Altvater","@id":"https:\/\/stackify.com\/#\/schema\/person\/3087594560b933be18c662a37d09b51a"},"headline":"What is Code Profiling? Learn the 3 Types of Code Profilers","datePublished":"2020-05-20T14:02:00+00:00","dateModified":"2023-05-01T17:08:40+00:00","mainEntityOfPage":{"@id":"https:\/\/stackify.com\/what-is-code-profiling\/"},"wordCount":731,"publisher":{"@id":"https:\/\/stackify.com\/#organization"},"image":{"@id":"https:\/\/stackify.com\/what-is-code-profiling\/#primaryimage"},"thumbnailUrl":"https:\/\/stackify.com\/wp-content\/uploads\/2020\/05\/prefix-code-profiler-881x441-1.jpg","keywords":["developer tips","developer tools"],"articleSection":["Developer Tips, Tricks &amp; Resources"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/stackify.com\/what-is-code-profiling\/","url":"https:\/\/stackify.com\/what-is-code-profiling\/","name":"What is Code Profiling? Learn the 3 Types of Code Profilers - Stackify","isPartOf":{"@id":"https:\/\/stackify.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/stackify.com\/what-is-code-profiling\/#primaryimage"},"image":{"@id":"https:\/\/stackify.com\/what-is-code-profiling\/#primaryimage"},"thumbnailUrl":"https:\/\/stackify.com\/wp-content\/uploads\/2020\/05\/prefix-code-profiler-881x441-1.jpg","datePublished":"2020-05-20T14:02:00+00:00","dateModified":"2023-05-01T17:08:40+00:00","description":"Learn what code profiling is, the 3 different types of code profilers (server-side, desktop, and hybrid) and how they can benefit your dev team.","inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/stackify.com\/what-is-code-profiling\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/stackify.com\/what-is-code-profiling\/#primaryimage","url":"https:\/\/stackify.com\/wp-content\/uploads\/2020\/05\/prefix-code-profiler-881x441-1.jpg","contentUrl":"https:\/\/stackify.com\/wp-content\/uploads\/2020\/05\/prefix-code-profiler-881x441-1.jpg","width":881,"height":441},{"@type":"WebSite","@id":"https:\/\/stackify.com\/#website","url":"https:\/\/stackify.com\/","name":"Stackify","description":"","publisher":{"@id":"https:\/\/stackify.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/stackify.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/stackify.com\/#organization","name":"Stackify","url":"https:\/\/stackify.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/stackify.com\/#\/schema\/logo\/image\/","url":"https:\/\/stackify.com\/wp-content\/uploads\/2024\/05\/logo-1.png","contentUrl":"https:\/\/stackify.com\/wp-content\/uploads\/2024\/05\/logo-1.png","width":1377,"height":430,"caption":"Stackify"},"image":{"@id":"https:\/\/stackify.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/Stackify\/","https:\/\/x.com\/stackify","https:\/\/www.instagram.com\/stackify\/","https:\/\/www.linkedin.com\/company\/2596184","https:\/\/www.youtube.com\/stackify"]},{"@type":"Person","@id":"https:\/\/stackify.com\/#\/schema\/person\/3087594560b933be18c662a37d09b51a","name":"Alexandra Altvater","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/stackify.com\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/99e0459a6d11f4f510127934dfd98b94?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/99e0459a6d11f4f510127934dfd98b94?s=96&d=mm&r=g","caption":"Alexandra Altvater"}}]}},"_links":{"self":[{"href":"https:\/\/stackify.com\/wp-json\/wp\/v2\/posts\/6290"}],"collection":[{"href":"https:\/\/stackify.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/stackify.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/stackify.com\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/stackify.com\/wp-json\/wp\/v2\/comments?post=6290"}],"version-history":[{"count":1,"href":"https:\/\/stackify.com\/wp-json\/wp\/v2\/posts\/6290\/revisions"}],"predecessor-version":[{"id":36874,"href":"https:\/\/stackify.com\/wp-json\/wp\/v2\/posts\/6290\/revisions\/36874"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/stackify.com\/wp-json\/wp\/v2\/media\/36873"}],"wp:attachment":[{"href":"https:\/\/stackify.com\/wp-json\/wp\/v2\/media?parent=6290"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/stackify.com\/wp-json\/wp\/v2\/categories?post=6290"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/stackify.com\/wp-json\/wp\/v2\/tags?post=6290"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}