Skip to content

Commit

Permalink
updated deps
Browse files Browse the repository at this point in the history
  • Loading branch information
wanderer committed May 18, 2018
1 parent 6bb7e16 commit e7082de
Show file tree
Hide file tree
Showing 4 changed files with 234 additions and 293 deletions.
15 changes: 9 additions & 6 deletions benchmark/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,15 @@ class BaseContainer {
this.actor = actor
}
onStartup () {}
static onCreation (code, id) {
static onCreation (code) {
const exp = {}
Object.getOwnPropertyNames(this.prototype).filter(name => name !== 'constructor').forEach(name => {
exp[name] = {}
})
return new ModuleRef(exp, id)
return {
exports: exp,
state: []
}
}
onMessage (message) {
return this[message.funcRef.identifier[1]](...message.funcArguments)
Expand Down Expand Up @@ -47,14 +50,14 @@ async function main (numOfActors, depth) {
}
}

const hypervisor = new Hypervisor({tree})
hypervisor.registerContainer(BenchmarkContainer)
const hypervisor = new Hypervisor({tree, meter: false})
hypervisor.registerModule(BenchmarkContainer)

const refernces = []
let _numOfActors = numOfActors
while (_numOfActors--) {
const {module} = hypervisor.createActor(BenchmarkContainer.typeId)
const funcRef = module.getFuncRef('main')
const actor = hypervisor.newActor(BenchmarkContainer)
const funcRef = actor.getFuncRef('main')
funcRef.gas = 1000
refernces.push(funcRef)
}
Expand Down
Loading

0 comments on commit e7082de

Please sign in to comment.