Git Product home page Git Product logo

webstorage119 / high-performance-cplusplus-profiler Goto Github PK

View Code? Open in Web Editor NEW

This project forked from michael-mayes/high-performance-cplusplus-profiler

0.0 1.0 0.0 172 KB

High performance C++ Profiler implementation currently for x86 processors under Windows/Linux

Home Page: https://floodyberry.wordpress.com/2009/10/07/high-performance-cplusplus-profiling/

License: MIT License

C++ 78.82% Makefile 1.00% HTML 20.17%

high-performance-cplusplus-profiler's Introduction

----
INFO
----

Automatically exported from http://code.google.com/p/high-performance-cplusplus-profiler to save it for posterity now that Google Code will be closed

Originally developed on Google Code by Andrew/liquidsun/floodyberry, but I cannot find a way to check in with him to confirm that it would be saved otherwise

Design described at https://floodyberry.wordpress.com/2009/10/07/high-performance-cplusplus-profiling/


------------
WHAT IS THIS
------------

A high performance multi-threaded C++ profiler, currently for x86 (32bit)
under Windows and Linux.


----------
QUICKSTART
----------

Add Profiler.cpp to your project, and #include "Profiler.h" to any file
you wish to profile.

(OPTIONAL)
Call Profiler::detect( argc, argv ) under any OS or 
Profiler::detect( commandLine ) under Win32 non-console  apps to autodetect 
program name and startup parameters (only used for html dumps).

Use PROFILE_SCOPED() at the start of any function you wish to profile.

Use PROFILE_THREAD_SCOPED() at the entry point of any thread you wish to
profile. The main thread is instantiated automatically.

Use Profiler::reset(); to reset the profile stats at any time

Use Profiler::dump(); to generate an ASCII report of the current profile

Use Profiler::dumphtml(); to generate an HTML report of the current profile
to the current directory.


---------------
Minimal Example
---------------

#include <stdlib.h>
#include "Profiler.h"

int test() {
	PROFILE_SCOPED()
	
	int i = 1;
	while ( i < 1000 )
		i *= ( rand() & 7 ) + 1;
	return i;
}

int main( int argc, const char *argv[] ) {
	Profiler::detect( argc, argv );
	for ( int i = 0; i < 100; i++ )
		test();
	Profiler::dump();
	return 0;
}

high-performance-cplusplus-profiler's People

Contributors

michael-mayes avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.