Demo
When used with the webkit heap profiler and timeline, this tool is useful for confirming action cleanliness and detecting memory leaks in your web application.
import looper from "https://cdn.jsdelivr.net/npm/[email protected]/dist-web/index.js"
- Create a heap profile under webkit tools 'Profile'.
- Using the browser's console, create a loop function, providing an array of functions to
looper
:var loop = looper([setup, teardown])
Record
activity in the webkit timeline.- Calling this function returns a Promise of the completion, which defaults to 27 runs. Run the function:
loop()
. - Let Looper finish.
- Stop recording in the webkit timeline.
- Create a second heap profile.
- Compare the two heaps and evaluate memory growth in the timeline.