Dumps a heap snapshot for each event in docpad, viewable in chrome profiler
Want to see pretty graphs? Log in now!
npm install docpad-plugin-heapdumper
|6||downloads in the last week|
|12||downloads in the last month|
|Last Published By|
|Version||2.0.3 last updated 5 months ago|
|Keywords||docpad, docpad-plugin, analysis, heap, heapdump|
HeapDump Plugin for DocPad
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
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'
- 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