fnx_profiler 0.9.1

  • README.md
  • CHANGELOG.md
  • Installing
  • Versions
  • 52

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

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

with Flutter:


$ flutter packages get

Alternatively, your editor might support pub get or packages 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

Analysis

This feature is new.
We welcome feedback.
More details: scoring.

We analyzed this package, and provided a score, details, and suggestions below.

  • completed on Feb 3, 2018
  • Dart: 2.0.0-dev.20.0
  • pana: 0.10.1

Scores

Popularity:
Describes how popular the package is relative to other packages. [more]
8 / 100
Health:
Code health derived from static analysis. [more]
98 / 100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
94 / 100
Overall score:
Weighted score of the above. [more]
52

Platforms

Detected platforms: Flutter, web, other

No platform restriction found in primary library package:fnx_profiler/fnx_profiler.dart.

Suggestions

  • The description is too short.

    Add more detail about the package, what it does and what is its target use case. Try to write at least 60 characters.

  • Package is pre-v1 release.

    While there is nothing inherently wrong with versions of 0.*.*, it usually means that the author is still experimenting with the general direction API.

  • Use analysis_options.yaml.

    Rename old .analysis_options file to analysis_options.yaml.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=1.0.0 <2.0.0
Dev dependencies
test >=0.12.0 <0.13.0