Open-source JavaScript heat map generation tool

Source: Internet
Author: User
This is a simple for loop in javascript. It declares that the initial I value is 0 and determines whether I is less than 100. If yes, It executes the statement and then increases I by 1. Therefore, vari = 0 is executed only once, and the conditional expression I & lt; 100 is executed

Each byte of code has its temperature, and we provide a code thermometer.

Double-click the source code
123 For (vari = 0; I <100; I ++) {console. log (I );}

This is a simple for loop in javascript. It declares that the initial I value is 0 and determines whether I is less than 100. If yes, It executes the statement and then increases I by 1. SoVar I = 0Execute only once, condition expressionI <1, 100Will Execute 101 times, incrementalI ++Executed 100 times,Console. log (I)Run 100 times.

Statement Times
Var I = 0 1
I <1, 100 101
I ++ 100
Console. log (I) 100

The conversion statement code maps the number of executions. We get a heat map of code execution, which vividly shows the actual code execution, it indicates the execution heat of each statement. We say this is the actual temperature of every byte code.

The heat map generated by the Code in the following quick sorting is displayed, and the javascript code coverage is shown in the lower right corner:

 

  • Link: http://madscript.com/jsprofiler
  • Github Source: https://github.com/yuanyan/jsprofiler

Reprinted please indicate the original address: http://www.alloyteam.com/2012/06/javascript-the-profiler

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.