fnx_profiler 0.9.1

  • README.md
  • CHANGELOG.md
  • Installing
  • Versions
  • 2

fnx_profiler

A library for Dart developers. It is awesome!

fnx_profiler is an "imperative" profiler. You manually mark blocks of code you want to profile. Profiler is hierarchical, you can add children to it and grandchildren to them, whole clans of profilers will help you to drill down to that performance bottleneck.

Use it like this:

import 'package:fnx_profiler/fnx_profiler.dart'

Profiler p = openRootProfiler("root");
// do something expensive
p.close();
printProfilerStats();

Or this:

Profiler p = openRootProfiler("root");
for (int a=0; a<3; a++) {
    Profiler ch = p.openChild("child");
    // do something nested
    ch.close();
}
p.close();

Or even this:

Profiler p = openRootProfiler("root");
await p.profileFuture("future", someFuture);
p.close();

Yes, it's pretty straightforward, even naive, but it works. Run your code, check the results at the end, find the bottleneck, optimize and repeat.

Example

Please see the full example. Example generates this output:

name                   |     calls|  avg (ms)|  min (ms)|  max (ms)|
--------------------------------------------------------------------
root                   |         1|    1219.0|      1219|      1219|
root.child0            |         1|     116.0|       116|       116|
root.child0.grandchild |         5|      22.6|        21|        24|
root.child1            |         1|     125.0|       125|       125|
root.child1.grandchild |         5|      24.6|        22|        26|
root.child2            |         1|     123.0|       123|       123|
root.child2.grandchild |         5|      24.2|        23|        25|
root.myFunction        |        10|      44.2|        42|        45|
root.myFuture          |        10|      33.4|        30|        35|

Features and bugs

Please file feature requests and bugs on Github.

Changelog

0.9.1

  • fixed typo in documentation: beginRootProfiler should be openRootProfiler

0.9.0

  • Initial version, created by Stagehand

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  fnx_profiler: ^0.9.1

2. Install it

You can install packages from the command line:

with pub:


$ pub get

Alternatively, your editor might support pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:fnx_profiler/fnx_profiler.dart';
  
Version Uploaded Documentation Archive
0.9.1 Jan 12, 2017 Go to the documentation of fnx_profiler 0.9.1 Download fnx_profiler 0.9.1 archive
0.9.0 Sep 15, 2016 Go to the documentation of fnx_profiler 0.9.0 Download fnx_profiler 0.9.0 archive
Popularity:
Describes how popular the package is relative to other packages. [more]
4
Health:
Code health derived from static analysis. [more]
0
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
0
Overall:
Weighted score of the above. [more]
2
Learn more about scoring.

The package version is not analyzed, because it does not support Dart 2. Until this is resolved, the package will receive a health and maintenance score of 0.

Issues and suggestions

Support Dart 2 in pubspec.yaml.

The SDK constraint in pubspec.yaml doesn't allow the Dart 2.0.0 release. For information about upgrading it to be Dart 2 compatible, please see https://www.dartlang.org/dart-2#migration.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=1.0.0 <2.0.0