Convert Figma logo to code with AI

google logoorbit

C/C++ Performance Profiler

4,160
344
4,160
42

Top Related Projects

PerfView is a CPU and memory performance-analysis tool

Stack trace visualizer

magic-trace collects and displays high-resolution traces of what a process is doing

4,059

The Linux perf GUI for performance analysis.

9,081

Record and Replay Framework

FlameScope is a visualization tool for exploring different time ranges as Flame Graphs.

Quick Overview

Orbit is an open-source profiling and debugging tool developed by Google. It is designed for capturing, visualizing, and analyzing performance data from Windows and Linux applications, with a focus on game development and other performance-critical software.

Pros

  • Powerful real-time profiling capabilities for CPU, GPU, and memory
  • User-friendly interface with intuitive visualization of performance data
  • Supports both Windows and Linux platforms
  • Extensible architecture allowing for custom plugins and data capture

Cons

  • Steep learning curve for advanced features
  • Limited documentation for some complex use cases
  • Primarily focused on game development, which may limit its applicability in other domains
  • Resource-intensive when profiling large applications

Getting Started

To get started with Orbit:

  1. Download the latest release from the GitHub releases page.
  2. Install Orbit on your system following the provided instructions.
  3. Launch Orbit and connect to your target application or system.
  4. Start capturing performance data using the available profiling options.
  5. Analyze the collected data using Orbit's visualization tools and features.

For detailed instructions and usage guidelines, refer to the Orbit User Guide.

Competitor Comparisons

PerfView is a CPU and memory performance-analysis tool

Pros of PerfView

  • More comprehensive analysis tools for .NET applications
  • Supports a wider range of data sources, including ETW events
  • Longer development history and larger community support

Cons of PerfView

  • Primarily focused on Windows and .NET environments
  • Steeper learning curve due to more complex features
  • Less modern user interface compared to Orbit

Code Comparison

PerfView (C#):

public static void Main(string[] args)
{
    CommandLineArgs parsedArgs = new CommandLineArgs(args);
    if (parsedArgs.HelpRequested)
        App.DisplayHelp();
    else
        App.Run(parsedArgs);
}

Orbit (C++):

int main(int argc, char* argv[]) {
  absl::ParseCommandLine(argc, argv);
  OrbitQt::MainWindow w;
  w.showMaximized();
  return QApplication::exec();
}

Both repositories focus on performance profiling, but target different platforms and ecosystems. PerfView is more suited for .NET developers working on Windows, while Orbit is designed for game developers and offers cross-platform support. PerfView provides more in-depth analysis tools, whereas Orbit emphasizes ease of use and real-time profiling capabilities.

Stack trace visualizer

Pros of FlameGraph

  • Lightweight and easy to use, requiring minimal setup
  • Language-agnostic, supporting a wide range of programming languages and platforms
  • Highly customizable with various options for visualization and data processing

Cons of FlameGraph

  • Command-line based, lacking a graphical user interface
  • Requires external profiling tools to generate input data
  • Limited real-time profiling capabilities

Code Comparison

FlameGraph (Perl):

my $ypad1 = $fontsize * 4;
my $ypad2 = $fontsize * 2;
my $xpad = 10;
my ($imagewidth, $imageheight) = ($xpad * 2 + $widthpertime * $timemax, $ypad1 + $ypad2 + $depthmax * $frameheight);

Orbit (C++):

void OrbitGl::DrawScreenSpace() {
  glViewport(0, 0, m_WindowWidth, m_WindowHeight);
  glMatrixMode(GL_PROJECTION);
  glLoadIdentity();
  glOrtho(0, m_WindowWidth, 0, m_WindowHeight, -1, 1);
}

While FlameGraph focuses on generating flame graph visualizations from profiling data, Orbit provides a more comprehensive profiling and visualization tool with a graphical interface. FlameGraph is simpler and more flexible, while Orbit offers more advanced features and real-time profiling capabilities.

magic-trace collects and displays high-resolution traces of what a process is doing

Pros of magic-trace

  • Lightweight and focused on trace collection and visualization
  • Supports both Linux and macOS operating systems
  • Provides a web-based UI for interactive trace exploration

Cons of magic-trace

  • Limited to tracing a single process at a time
  • Lacks advanced features like live capture and system-wide profiling
  • Requires root access for certain operations

Code comparison

magic-trace:

let collect_trace ~pid ~duration =
  let trace = Trace.create () in
  Trace.start trace ~pid;
  Unix.sleep duration;
  Trace.stop trace;
  trace

Orbit:

void OrbitApp::StartCapture() {
  capture_client_->StartCapture(
      [this](const orbit_grpc_protos::CaptureEvent& event) {
        OnCaptureEvent(event);
      });
}

Both projects aim to provide performance analysis tools, but they differ in scope and implementation. magic-trace focuses on lightweight trace collection and visualization, while Orbit offers a more comprehensive suite of profiling and debugging features. magic-trace's simplicity and cross-platform support are advantages, but it lacks some of the advanced capabilities found in Orbit, such as live capture and system-wide profiling. The code snippets illustrate the different approaches: magic-trace uses OCaml for a concise trace collection function, while Orbit employs C++ for its more complex capture initialization process.

4,059

The Linux perf GUI for performance analysis.

Pros of Hotspot

  • Cross-platform support (Linux, macOS, Windows)
  • Integration with perf and other Linux profiling tools
  • User-friendly GUI with interactive flame graphs

Cons of Hotspot

  • Less comprehensive system-wide profiling compared to Orbit
  • Fewer advanced features for game developers
  • Limited support for custom instrumentation

Code Comparison

Hotspot (Qt-based GUI):

void MainWindow::on_recordButton_clicked()
{
    if (m_recording) {
        stopRecording();
    } else {
        startRecording();
    }
}

Orbit (ImGui-based GUI):

void OrbitMainWindow::OnToggleCapture() {
  if (GOrbitApp->IsCapturing()) {
    GOrbitApp->StopCapture();
  } else {
    GOrbitApp->StartCapture();
  }
}

Both projects use C++ for their core functionality, but Hotspot relies on Qt for its GUI, while Orbit uses ImGui. Orbit's codebase is more focused on game development and system-wide profiling, whereas Hotspot is designed for general-purpose profiling with a strong emphasis on Linux systems.

Orbit provides more extensive features for game developers, including GPU profiling and memory analysis. Hotspot, on the other hand, offers better integration with existing Linux profiling tools and a more accessible interface for general users.

9,081

Record and Replay Framework

Pros of rr

  • Supports reverse execution, allowing developers to step backwards through program execution
  • Lightweight and focused on record-and-replay debugging
  • Can be used with various programming languages and debuggers

Cons of rr

  • Limited to Linux systems, reducing cross-platform compatibility
  • May have performance overhead during recording phase
  • Lacks built-in profiling and performance analysis tools

Code Comparison

rr example (recording a program):

rr record ./my_program
rr replay

Orbit example (profiling a program):

#include <orbit/orbit.h>

void FunctionToProfile() {
  ORBIT_SCOPE("FunctionToProfile");
  // Function code here
}

Key Differences

  • Orbit focuses on profiling and performance analysis, while rr specializes in record-and-replay debugging
  • Orbit provides a graphical user interface for visualizing performance data, whereas rr is primarily command-line based
  • rr offers reverse debugging capabilities, which Orbit does not include
  • Orbit supports Windows and Linux, while rr is Linux-only
  • Orbit integrates closely with game development and real-time applications, while rr is more general-purpose

Both tools serve different purposes in the debugging and profiling ecosystem, with rr excelling at deterministic debugging and Orbit providing comprehensive performance analysis features.

FlameScope is a visualization tool for exploring different time ranges as Flame Graphs.

Pros of Flamescope

  • Web-based interface, making it more accessible across different platforms
  • Focuses specifically on flame graphs, providing a specialized tool for this visualization
  • Supports multiple file formats for input data, including perf and eBPF

Cons of Flamescope

  • Limited to flame graph visualization, while Orbit offers a broader range of profiling tools
  • Less frequently updated compared to Orbit, which may impact bug fixes and new features
  • Lacks some advanced features like live profiling and memory analysis found in Orbit

Code Comparison

Flamescope (Python):

@app.route('/profile/<filename>')
def profile(filename):
    return send_from_directory(app.config['PROFILE_DIR'], filename)

Orbit (C++):

void OrbitApp::LoadCapture(const std::string& capture_filename) {
  capture_loading_cancellation_.Reset();
  LoadCaptureFromFile(capture_filename);
}

Summary

Flamescope is a specialized web-based tool for flame graph visualization, offering easy accessibility and support for multiple input formats. Orbit, on the other hand, provides a more comprehensive profiling toolkit with advanced features like live profiling and memory analysis. While Flamescope excels in its specific focus, Orbit offers a broader range of profiling capabilities for developers needing more extensive analysis tools.

Convert Figma logo designs to code with AI

Visual Copilot

Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.

Try Visual Copilot

README

ORBIT

builds and tests Debian package OpenSSF Scorecard

ORBIT Logo

Orbit, the Open Runtime Binary Instrumentation Tool is a standalone native application profiler for Windows and Linux. It supports native applications written in languages such as C, C++, Rust, or Go. Its main purpose is to help developers identify the performance bottlenecks of a complex application. Orbit can be also used to visualize the execution flow of such applications.

The key differentiator with many existing tools is that no alteration to the target process is necessary. Orbit does not require you to change a single line of code. It doesn't require you to recompile or even relaunch the application you want to profile. Everything is done seamlessly, right when you need it. It requires zero integration time and zero iteration time.

Orbit combines sampling and dynamic instrumentation to optimize the profiling workflow. Sampling can quickly identify interesting functions to instrument. Dynamic instrumentation results in exact function entry and exit information which is presented in the form of per-thread hierarchical call graphs. Manual instrumentation markers can be added to the source code and further allows for value-tracking. Scheduling events are also shown to visualize when a thread was running and on what core. Furthermore, Orbit visualizes thread dependencies, showing which thread got blocked or unblocked by which other thread. For AMD GPUs, the submission, scheduling and hardware execution timings of a job is visualized. Additional GPU data, such as Vulkan debug markers can be retrieved using Orbit's Vulkan layer. Memory consumption and page-fault information is visualized as well.

An introduction to Orbit's key features can be found in the following YouTube video: Orbit Presentation

Features

  • Dynamic Instrumentation (no code change required)
  • Callstack Sampling
  • Wine/Proton Mixed-Callstack Profiling
  • Thread Scheduling and Dependency Tracing
  • Memory Tracing
  • GPU Driver Tracepoints (AMD only)
  • Vulkan Debug Label and Command Buffer Tracing (AMD only)
  • Manual Instrumentation
  • Source Code and Disassembly View
  • Remote Profiling
  • Debug Symbol Parsing (ELF, DWARF, PE and PDB)
  • Full Serialization of Captured Data

Note

Orbit's focus has shifted to the Linux version. Windows local profiling is currently only supported partially and major features, such as dynamic instrumentation, are not yet implemented. It is possible however to profile Linux executables from a Windows UI instance. For Windows local profiling, you can still use the released binaries, but please note that they are deprecated and mostly undocumented.

Build

Please have a look at the first three sections of our development documentation. It describes how to build Orbit and which compilers, platforms, and tools are supported and needed.

Workflow

Note An extensive documentation of the usage of Orbit can be found in our usage documentation.

The following describes the basic workflow of Orbit:

  1. Select a process in the list of currently running processes in the connection setup dialog, and click Start Session.
  2. The list of loaded modules will appear at the top of the Symbols tab.
  3. Orbit tries to automatically retrieve debug information of the modules. See here on how to load symbols for modules Orbit failed to load. For successfully loaded module symbols, the Functions tab will get populated.
  4. Select functions you wish to dynamically instrument in the Functions tab by Right-Click and choosing Hook.
  5. Start profiling by pressing F5. To stop profiling, press F5 again. You can either zoom time using W and S or Ctrl + the scroll wheel. You can also Ctrl+Right-Click and drag to zoom to a specific time range. To scale the UI, press Ctrl + +/-. Press SPACE to see the last 2 seconds of capture.
  6. You can select sections of the per-thread sampling event track to get a sampling report of your selection.

Presets

Once you have loaded the debug information for your modules and have chosen functions of interest to dynamically instrument, you can save your profiling preset so that you won't have to do this manually again. To save a preset, go to File > Save Preset

Feedback

Questions and comments are more than welcome: please open an issue.

About

Orbit was created by Pierric Gimmig, but is now developed and maintained by a team of engineers at Google. The current maintainers are:

License

License (BSD 2-clause)

OSI Approved License
Copyright (c) 2020 The Orbit Authors. All rights reserved.

BSD 2-Clause License

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

* Redistributions of source code must retain the above copyright notice, this
  list of conditions and the following disclaimer.

* Redistributions in binary form must reproduce the above copyright notice,
  this list of conditions and the following disclaimer in the documentation
  and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.