This repository has been archived by the owner on May 15, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
faster Promise2 (using Microtask) that won't allow to idle when tasks available
- Loading branch information
Showing
59 changed files
with
2,638 additions
and
3,450 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,34 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head></head> | ||
<body> | ||
<script type="text/javascript" src="source/polyfills/promise.js"></script> | ||
<script type="text/javascript" src="jspspemu.js"></script> | ||
<div id="output" style="font: 14px 'Lucida Console', Monaco, monospace;white-space: pre;"></div> | ||
<div id="errors" style="font: 14px 'Lucida Console', Monaco, monospace;white-space: pre;color:red;"></div> | ||
<script type="text/javascript"> | ||
var errors = document.getElementById('errors'); | ||
|
||
window.onerror = function (errorMsg, url, lineNumber) { | ||
errors.innerText += 'Error: ' + errorMsg + ' Script: ' + url + ' Line: ' + lineNumber + "\n"; | ||
}; | ||
|
||
var Emulator = require('src/emulator').Emulator; | ||
var MemoryAsyncStream = require('src/core/stream').MemoryAsyncStream2; | ||
//Emulator.disableLog(); | ||
var emu = new Emulator(); | ||
var output = document.getElementById('output'); | ||
|
||
UrlAsyncStream.fromUrlAsync('data/benchmark/benchmark.prx').then(function(stream) { | ||
return emu.loadExecuteAndWaitAsync(stream, 'benchmark.prx', function() { | ||
emu.context.onStdout.add(function(data) { | ||
output.textContent = output.textContent + data; | ||
//console.log(data); | ||
//process.stdout.write(data); | ||
}); | ||
}).then(function(output) { | ||
//console.log(output); | ||
}); | ||
}); | ||
</script> | ||
</body> | ||
</html> | ||
<!DOCTYPE html> | ||
<html> | ||
<head></head> | ||
<body> | ||
<script type="text/javascript" src="jspspemu.js"></script> | ||
<div id="output" style="font: 14px 'Lucida Console', Monaco, monospace;white-space: pre;"></div> | ||
<div id="errors" style="font: 14px 'Lucida Console', Monaco, monospace;white-space: pre;color:red;"></div> | ||
<script type="text/javascript"> | ||
var errors = document.getElementById('errors'); | ||
|
||
window.onerror = function (errorMsg, url, lineNumber) { | ||
errors.innerText += 'Error: ' + errorMsg + ' Script: ' + url + ' Line: ' + lineNumber + "\n"; | ||
}; | ||
|
||
var Emulator = require('src/emulator').Emulator; | ||
var MemoryAsyncStream = require('src/core/stream').MemoryAsyncStream2; | ||
//Emulator.disableLog(); | ||
var emu = new Emulator(); | ||
var output = document.getElementById('output'); | ||
|
||
UrlAsyncStream.fromUrlAsync('data/benchmark/benchmark.prx').then(function(stream) { | ||
return emu.loadExecuteAndWaitAsync(stream, 'benchmark.prx', function() { | ||
emu.context.onStdout.add(function(data) { | ||
output.textContent = output.textContent + data; | ||
//console.log(data); | ||
//process.stdout.write(data); | ||
}); | ||
}).then(function(output) { | ||
//console.log(output); | ||
}); | ||
}); | ||
</script> | ||
</body> | ||
</html> |
Binary file not shown.
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
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
Oops, something went wrong.