Giter Club home page Giter Club logo

hs-speedscope's Introduction

hs-speedscope

hs-speedscope is a simple executable for converting an eventlog into a format suitable to load into speedscope.

WARNING: Only GHC 8.10 supports generating an eventlog with the correct events for this program to work.

Usage

  1. Create an eventlog which contains time profiling events by running your program with program +RTS -p -l-au.
  2. Run hs-speedscope on the resulting eventlog hs-speedscope program.eventlog.
  3. Load the resulting program.eventlog.json file into speedscope to visualise the profile.

Installation

cabal update
cabal install exe:hs-speedscope

This will install to cabal's per-user default location: ~/.cabal/bin/hs-speedscope.

Filtering an eventlog

It is sometimes useful to isolate a specific part of the sample, for example, when I was profiling ghcide, I want to isolate a single hover request.

The --start and --end options can be used to indicate which parts of the eventlog to keep. The filtering options look for messages inserted into the eventlog by traceMarker events.

  • No events before the first marker which matches the prefix given by --start will be included in the result
  • No events after the first marker which matches the prefix given by --end will be included in the result.

For example, the following invocation will filter the profile between the START and END markers.

hs-speedscope File.eventlog --start START --end END

hs-speedscope's People

Contributors

mhansen avatar mpickering avatar ocharles avatar phadej avatar sorki avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

hs-speedscope's Issues

New release for 8.10.2

Hello,
0.2 from Hackage won't build with GHC 8.10.2. How about releasing a new version with 9e28b30 ? Thanks in advance.

Can IO heavy code ever have accurate timing?

I'm profiling some fairly IO heavy code (it does database transactions to a database with high latency), and my profile takes about a minute for me to run. However, when I load this into speedscope.app, the whole session apparently only took 21s. I think this is because the timing is only measuring what happens in MUT, rather than being actual wall clock time. Is it possible to have wall clock time? Or is this information not in event logs?

Hackage release?

Hello! Would it be possible to get a new Hackage release? In particular, ghc-events's upper bound became too dated in the current release (0.2.1), which, in turn, broke the package in nixpkgsโ€ฆ

Could you add installation instructions to the README?

Hi there, first up, thanks for making this, it looks like exactly what I need. I was struggling with profiteur and profiterole to look at profiles, I really wanted the awesome tools like speedscope I'd gotten used to in other languages. Bravo!

A suggestion... can you mention how to install this program? I'm not really good with Haskell. I'm just trying to profile a slow Haskell application that somebody else wrote. I don't really understand when to use cabal vs stack vs hackage vs git clone-ing and running directly.

I'm sure I'll figure it out eventually, but it would be fantastic to spell it out in the docs for others.

Adoption/co-maintainership?

Following on from #6, I'd love to help support this project. Right now it looks like it's in somewhat of a proof-of-concept state. I'm happy to put in some hours and give it a bit more love. Immediate thoughts are slightly better error handling (e.g., above just calling error) and adding proper data types that mirrors the Speedscope schema. I'd also like to get some GitHub actions setup so we have CI.

I'm happy to do this via PRs, but if you trust me, I'd also be happy to take a commit bit and go to town on this.

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.