GithubHelp home page GithubHelp logo

fuuzetsu / ghc-events-analyze Goto Github PK

View Code? Open in Web Editor NEW

This project forked from well-typed/ghc-events-analyze

0.0 3.0 0.0 808 KB

License: BSD 3-Clause "New" or "Revised" License

Haskell 100.00%

ghc-events-analyze's Introduction

ghc-events-analyze

See Performance profiling with ghc-events-analyze for an introduction to this tool. Below we describe some features that were introduced since the blog post.

Controlling layout

As of version 0.2.3, there are a number of options for controlling the layout. To slice time coarsely, as we did in the blog post, you can run

ghc-events-analyze -b 50 ...

This results in something like

By default (in 0.2.0 and again from 0.2.3) time is split into 100 buckets. To slice time more finely (this was the default for versions 0.2.1 and 0.2.2), you can run

ghc-events-analyze -b 500 --tick-every 10 --bucket-width 1 --border-width 0

The results in something like

Windowing

Windowing can be used to split all events into a bunch of reports, one per window. You can use it like this:

  traceEventIO "START WINDOW"
  ...
  traceEventIO "STOP WINDOW"

  traceEventIO "START WINDOW"
  ...
  traceEventIO "STOP WINDOW"

  traceEventIO "START WINDOW"
  ...
  traceEventIO "STOP WINDOW"

If you then run ghc-events-analyze using --window "WINDOW" it will create one report per window; for instance, in the above example it would create

example.0.timed.svg
example.1.timed.svg
example.2.timed.svg

Event subscripts

Suppose you have multiple events that should all show up as request in the generated reports, but should nonetheless be distinguished from each other. There are two ways to do this. One is to call the events request0, request1, etc.

traceEventIO "START request0"
...
traceEventIO "STOP request0"

traceEventIO "START request1"
...
traceEventIO "STOP request1"

and then use the ghc-events-analyze DSL to add some renaming instructions. However, that might get tedious if there are a lof of these. Alternatively, you can use event subscripts, like this:

traceEventIO "START 0 request"
...
traceEventIO "STOP 0 request"

traceEventIO "START 1 request"
...
traceEventIO "STOP 1 request"

These subscripts are used to distinguish events, but do not show up in the report.

ghc-events-analyze's People

Contributors

edsko avatar willsewell avatar qnikst avatar cartazio avatar dcoutts avatar basvandijk avatar idontgetoutmuch avatar ganeshrapolu avatar

Watchers

James Cloos avatar Mateusz Kowalczyk avatar  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.