Chrome Canary 63 seems to be having a performance problem running the following code when the inspector/console is open in chrome. To recreate open the html page open the console then refresh it then halts all execution.
Last active
September 22, 2017 21:32
-
-
Save johnsonjo4531/5e79eca32a6b32d51fea302d89d5ccf9 to your computer and use it in GitHub Desktop.
Chrome 63 Async Iteration inspector performance problem
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<meta http-equiv="X-UA-Compatible" content="ie=edge"> | |
<title>Document</title> | |
<script src="script.js"></script> | |
<style> | |
body { | |
padding: 20px; | |
font-family: Arial, Helvetica, sans-serif; | |
} | |
#out { | |
font-size: 4em; | |
} | |
</style> | |
</head> | |
<body> | |
<p> | |
This page will hang when the console is open on startup in chrome canary 63. Try interacting with it with and without the console on startup. | |
</p> | |
<button id="count">Increment</button> | |
<div id="out">0</div> | |
<script> | |
var count = 0; | |
document.getElementById("count").addEventListener("click", ()=>{ | |
document.getElementById("out").innerHTML = ++count; | |
}); | |
</script> | |
</body> | |
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
async function* asyncRange(from, to) { | |
for (let i = from; i < to; i++) { | |
yield i; | |
} | |
} | |
async function main() { | |
let total = 0; | |
const iter = asyncRange(0, 550000); | |
while (true) { | |
const result = await iter.next(); | |
if (result.done) break; | |
total += result.value; | |
} | |
console.log(total); | |
} | |
main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Link to public block https://bl.ocks.org/johnsonjo4531/5e79eca32a6b32d51fea302d89d5ccf9