#profiling #optimization #multithreading

microprofile

microprofile is a small library for profiling and optimizing multithreaded programs

5 unstable releases

✓ Uses Rust 2018 edition

0.2.1 Aug 15, 2019
0.2.0 Aug 5, 2019
0.1.0 Mar 15, 2019
0.0.2 Mar 15, 2019
0.0.1 Mar 10, 2019

#20 in Profiling

Download history 19/week @ 2019-07-07 16/week @ 2019-07-14 16/week @ 2019-07-21 12/week @ 2019-07-28 38/week @ 2019-08-04 27/week @ 2019-08-11 12/week @ 2019-08-18 78/week @ 2019-08-25 27/week @ 2019-09-01 27/week @ 2019-09-08 19/week @ 2019-09-15 50/week @ 2019-09-22 22/week @ 2019-09-29 7/week @ 2019-10-06 11/week @ 2019-10-13

85 downloads per month

MIT license

735KB
15K SLoC

C++ 11K SLoC // 0.0% comments C 3K SLoC // 0.7% comments Assembly 381 SLoC // 0.0% comments Rust 339 SLoC

Build Status

microprofile-rust

microprofile-rust is a profiler for profiling and optimizing multithreaded game code

Its a rust port of microprofile:

Which in turn depends on the excellent distorm project

Integration

Add microprofile as a dependency:

[dependencies]
microprofile = "0.2.1"

microprofile is meant to be called from a game engine every frame. to do this you call microprofile::flip every frame. If your program is not framebased, you can use microprofile::start_auto_flip(delay_in_ms) and microprofile::stop_auto_flip(), which will make microprofile call this function itself every delay_in_ms ms.

To time some code, you insert a scope in your program

microprofile::scope!("group-name", "timer-name");

All of microprofile-rust's functions are available as macros. Use the feature "disabled" to fully disable all the macros, and remove all the microprofile code instrumentation

[dependencies.microprofile]
version = "0.2.1"
features = ["disabled"]

Limitations

As of version 0.2.1 only a subset of microprofile is supported:

  • Scope timers are supported
  • Dynamic instrumentation is supported
  • Windows, Linux and OSX is supported

The following features are not supported:

  • GPU timers
  • Counters

Using the UI

Please see the microprofile documentation : https://github.com/jonasmr/microprofile

Example code

Updates

  • 0.2.0: Update to microprofile 3.1: Firefox support, quality of life features for programs with -many- threads
  • 0.2.1: Update to latest microprofile: Fix a nasty perf regression in the live view.

No runtime deps