docpad-plugin-heapdumper

Dumps a heap snapshot for each event in docpad, viewable in chrome profiler

npm install docpad-plugin-heapdumper
6 downloads in the last week
12 downloads in the last month

HeapDump Plugin for DocPad

NPM version Dependency Status Gittip donate button

Generates heap snapshots during specified docpad events that can be loaded in to the chrome profiler. Snapshot files are generated in the root of docpad by default

Config

plugins:
    heapdumper:
        # default output path relative to the docpad root path
        snapshotPath: "snapshots"
        # default events that this plugin write a snapshot at (change to suit your docpad instance)
        events: [
            'writeAfter' # (default)
        ]
Events that can be used
    'generateBefore'
    'generateAfter'
    'parseBefore'
    'parseAfter'
    'populateCollectionsBefore'
    'populateCollections'
    'contextualizeBefore'
    'contextualizeAfter'
    'renderBefore'
    'renderAfter'
    'renderCollectionBefore'
    'renderCollectionAfter'
    'writeBefore'
    'writeAfter' # (default)
    'serverBefore'
    'serverAfter'

Tip

  • Generate a snapshot heap and make some changes i.e. turn off the docpad logger
  • Generate another snapshot then compare these snapshots using chrome (due to a bug in chrome at time of writing this tip I use Chrome Canary to compare snapshots)

To compare in chrome canary do this:

  • Open chrome canary, goto the dev tools->profiles tab.
  • Right click on the word "Profiles" hightlighted in blue (on the left side).
  • Choose load and find your snapshots
  • Add the two snapshots in ascending date order i.e. "before" then "after". (the order of loading is very important)
  • Now view the latest snapshot (will be second in the list on the left)
  • Where it says "summary" at the bottom, change it to "comparision".
  • Chrome should automatially make the comparision and show the results

History

You can discover the history inside the History.md file

Contributing

You can discover the contributing instructions inside the Contributing.md file

License

Licensed under the incredibly permissive MIT License
Copyright © 2013+ Stringz Solutions Ltd
Copyright © 2013+ Peter Flannery

npm loves you