Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/stuartcarnie/jstrace
Firebug extension for tracing executing javascript code are generate call tree
https://github.com/stuartcarnie/jstrace
Last synced: 6 days ago
JSON representation
Firebug extension for tracing executing javascript code are generate call tree
- Host: GitHub
- URL: https://github.com/stuartcarnie/jstrace
- Owner: stuartcarnie
- License: mit
- Created: 2011-06-16T23:27:50.000Z (over 13 years ago)
- Default Branch: master
- Last Pushed: 2011-06-17T00:19:02.000Z (over 13 years ago)
- Last Synced: 2023-04-14T06:38:28.690Z (over 1 year ago)
- Language: JavaScript
- Homepage:
- Size: 113 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: license.txt
Awesome Lists containing this project
README
# jstrace
jstrace is a Firebug extension which adds a new tab to collect call data followed by the generation of a complete call tree.## License
jstrace is written by Stuart Carnie and is MIT licensed## Repository
[http://github.com/scarnie/jstrace](http://github.com/scarnie/jstrace)## Usage
1. Open Firebug and enable the Script tab
1. Switch to the jstrace tab, and click the Trace button to toggle tracing (defaults to off)
1. Once finished, click the Trace button again to generate the call tree
* __NOTE__: You can ALT+CLICK a node to see more information about that function call,
including links to the function definition and call sites in parent node (caller)## Performance
Naturally you would expect some slowdown, however be prepared for a significant amount (up to 100x).
The heavy lifting occurs in `TraceListener.processFunctionCall`, which is called back for every function call.
I've isolated the poor performance to converting the jsd stack frame into a safe frame that will remain valid
after tracing completes. As per [this][jsdIStackFrame] documentation, the stack frame object is only valid for the duration
of the call, and therefore we must do this during profiling. Simply calling `frame.line` or `frame.script.tag`
causes a huge performance hit, suggesting these native objects perform poorly when marshaling data or remain
uninitialized until the first property is accessed.[jsdIStackFrame]: http://xulrunner-1.9.sourcearchive.com/documentation/1.9.0.14plus-pbuild2plus-pnobinonly/interfacejsdIStackFrame.html