{"id":9981,"date":"2024-05-06T10:25:54","date_gmt":"2024-05-06T08:25:54","guid":{"rendered":"https:\/\/store.algosyntax.com\/?post_type=asx-lms-tutorial-cpt&#038;p=9981"},"modified":"2026-03-09T03:52:09","modified_gmt":"2026-03-09T01:52:09","slug":"how-to-profile-performance-in-unreal-engine","status":"publish","type":"asx-lms-tutorial-cpt","link":"https:\/\/store.algosyntax.com\/tutorials\/unreal-engine\/how-to-profile-performance-in-unreal-engine\/","title":{"rendered":"How to profile performance in Unreal Engine."},"content":{"rendered":"\t\t<div data-elementor-type=\"wp-post\" data-elementor-id=\"9981\" class=\"elementor elementor-9981\" data-elementor-post-type=\"asx-lms-tutorial-cpt\">\n\t\t\t\t<div class=\"elementor-element elementor-element-62989bd e-flex e-con-boxed e-con e-parent\" data-id=\"62989bd\" data-element_type=\"container\" data-e-type=\"container\">\n\t\t\t\t\t<div class=\"e-con-inner\">\n\t\t\t\t<div class=\"elementor-element elementor-element-148b5a7 elementor-widget elementor-widget-text-editor\" data-id=\"148b5a7\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t\t\t\t\t\t<p>Profiling is a critical step in optimizing game performance in Unreal Engine. One way to monitor specific areas of your code is to use <code>stat startfile<\/code> and <code>stat stopfile<\/code> commands. These commands help capture profiling data for in-depth analysis, enabling you to identify and fix performance bottlenecks.<\/p><h3>Overview<\/h3><p><code>stat startfile<\/code> and <code>stat stopfile<\/code> are console commands that generate a profiling data file (.ue4stats) for Unreal Engine&#8217;s built-in <strong>Unreal Insights<\/strong> tool. You can use them to focus on certain sections of your gameplay or visualize the overall performance over time.<\/p><h3>Getting Started with Profiling<\/h3><p><strong>Step 1: Launching Your Project<\/strong><\/p><ol><li>Open your project in Unreal Engine.<\/li><li>Start playing your game either in the editor (PIE) or by launching a standalone game.<\/li><\/ol><p>\u00a0<\/p><p><strong>Step 2: Running the Commands<\/strong><\/p><ol><li>Press the <code>~<\/code> key (or your project&#8217;s console key) to bring up the console command line.<\/li><li>Enter <code>stat startfile<\/code> to begin recording profiling data.<\/li><li>Play your game normally while the profiling data is being recorded.<\/li><li>Enter <code>stat stopfile<\/code> when you&#8217;re ready to stop profiling.<\/li><\/ol><p>This generates a .ue4stats file and stores it in the project&#8217;s <code>Saved\/Profiling\/UnrealStats<\/code> folder.<br \/><br \/><\/p><h3>Step 3: Analyzing the Data with the Session Frontend<\/h3><p>Once you have recorded profiling data using <code>stat startfile<\/code> and <code>stat stopfile<\/code>, you can use Unreal Engine&#8217;s <strong>Session Frontend<\/strong> to analyze the results.<\/p><ol><li><p><strong>Open Session Frontend:<\/strong><\/p><ul><li>In the Unreal Engine editor, open the Session Frontend via &#8220;Tools&#8221; &gt; &#8220;Session Frontend.&#8221;<\/li><\/ul><\/li><li><p><strong>Access Profiler Tab:<\/strong><\/p><ul><li>In the Session Frontend, switch to the &#8220;Profiler&#8221; tab. This tab allows you to open profiling files for analysis.<\/li><\/ul><\/li><li><p><strong>Load Profiling Data:<\/strong><\/p><ul><li>Click the &#8220;Load&#8221; button in the toolbar to browse for the profiling data you generated in Step 2 (located in the <code>Saved\/Profiling\/UnrealStats<\/code> folder).<\/li><li>Select the appropriate .ue4stats file and click &#8220;Open.&#8221;<\/li><\/ul><\/li><li><p><strong>Examine the Data:<\/strong><\/p><ul><li><strong>Frame Graphs:<\/strong> Analyze the graph to see frame times and breakdowns for each frame. You can see spikes indicating where the frame rate drops.<\/li><li><strong>CPU Usage:<\/strong> Check how much processing time each game thread uses. This helps identify the heaviest threads that may need optimization.<\/li><li><strong>GPU Usage:<\/strong> Understand GPU frame times to identify graphics-related bottlenecks.<\/li><li><strong>Memory Usage:<\/strong> See how much memory the game uses over time, which can reveal memory leaks or high usage scenarios.<\/li><\/ul><\/li><li><p><strong>Inspect Specific Time Ranges:<\/strong><\/p><ul><li>Click and drag on the graphs to zoom in on specific time ranges. This feature lets you focus on particular moments that had performance issues.<\/li><\/ul><\/li><li><p><strong>Compare Multiple Sessions:<\/strong><\/p><ul><li>You can load multiple profiling sessions in the Profiler to compare how different changes impact performance.<\/li><\/ul><\/li><\/ol><p>By following these steps and using the Session Frontend effectively, you can gain valuable insights into the performance characteristics of your Unreal Engine project, enabling you to target specific areas for optimization.<\/p><p>\u00a0<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t","protected":false},"featured_media":0,"template":"","asx-lms-tutorial-categories":[45],"asx-lms-tutorial-tags":[46],"class_list":["post-9981","asx-lms-tutorial-cpt","type-asx-lms-tutorial-cpt","status-publish","hentry","asx-lms-tutorial-categories-unreal-engine","asx-lms-tutorial-tags-cpp","entry"],"acf":[],"_links":{"self":[{"href":"https:\/\/store.algosyntax.com\/asx-rest\/wp\/v2\/asx-lms-tutorial-cpt\/9981","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/store.algosyntax.com\/asx-rest\/wp\/v2\/asx-lms-tutorial-cpt"}],"about":[{"href":"https:\/\/store.algosyntax.com\/asx-rest\/wp\/v2\/types\/asx-lms-tutorial-cpt"}],"version-history":[{"count":0,"href":"https:\/\/store.algosyntax.com\/asx-rest\/wp\/v2\/asx-lms-tutorial-cpt\/9981\/revisions"}],"wp:attachment":[{"href":"https:\/\/store.algosyntax.com\/asx-rest\/wp\/v2\/media?parent=9981"}],"wp:term":[{"taxonomy":"asx-lms-tutorial-categories","embeddable":true,"href":"https:\/\/store.algosyntax.com\/asx-rest\/wp\/v2\/asx-lms-tutorial-categories?post=9981"},{"taxonomy":"asx-lms-tutorial-tags","embeddable":true,"href":"https:\/\/store.algosyntax.com\/asx-rest\/wp\/v2\/asx-lms-tutorial-tags?post=9981"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}