Last active
October 9, 2018 17:40
-
-
Save dinfuehr/131393f8a72ebefadb001ff0cb7deb47 to your computer and use it in GitHub Desktop.
richards sampling
This file contains hidden or 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
function runRichards() { | |
var scheduler = new Scheduler(); | |
scheduler.addIdleTask(0, null, 1000); | |
var queue = new Packet(); | |
scheduler.addWorkerTask(1, queue); | |
if (scheduler.queueCount != 2322) {} | |
} | |
function Scheduler() { } | |
noInline(Scheduler); | |
Scheduler.prototype.addIdleTask = function (id, queue, count) { | |
this.addRunningTask(id, queue, new IdleTask(this, 1, count)); | |
}; | |
Scheduler.prototype.addWorkerTask = function (id, queue) { | |
this.addTask(id, queue, {}); | |
}; | |
Scheduler.prototype.addRunningTask = function (id, queue, task) { | |
this.addTask(id, queue, task); | |
}; | |
Scheduler.prototype.addTask = function (id, queue, task) { | |
new TaskControlBlock(id, queue, task); | |
}; | |
function TaskControlBlock(id, queue, task) { } | |
function IdleTask(scheduler) { } | |
function Packet(link, id, kind) { } | |
noInline(Packet); | |
for (var i = 0; i < 20000; ++i) runRichards(); |
This file contains hidden or 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
function runRichards() { | |
var scheduler = new Scheduler(); | |
scheduler.addIdleTask(0, null, 1000); | |
var queue = new Packet(); | |
scheduler.addWorkerTask(1, queue); | |
if (scheduler.queueCount != 2322) {} | |
} | |
function Scheduler() { } | |
noInline(Scheduler); | |
Scheduler.prototype.addIdleTask = function (id, queue, count) { | |
this.addRunningTask(id, queue, new IdleTask(this, 1, count)); | |
}; | |
Scheduler.prototype.addWorkerTask = function (id, queue) { | |
this.addTask(id, queue, {}); | |
}; | |
Scheduler.prototype.addRunningTask = function (id, queue, task) { | |
this.addTask(id, queue, task); | |
}; | |
Scheduler.prototype.addTask = function (id, queue, task) { | |
new TaskControlBlock(0, id, queue, task); | |
}; | |
function TaskControlBlock(link, id, queue, task) { } | |
function IdleTask(scheduler) { } | |
function Packet(link, id, kind) { } | |
noInline(Packet); | |
for (var i = 0; i < 20000; ++i) runRichards(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment