Skip to content

Commit

Permalink
benchmark: Update benchmark file to make use of latest API
Browse files Browse the repository at this point in the history
  • Loading branch information
notheotherben committed Nov 17, 2015
1 parent 2dabf54 commit e37b56e
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 8 deletions.
17 changes: 9 additions & 8 deletions benchmarks/mongodb.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/// <reference path="../_references.d.ts" />
/// <reference path="../typings/DefinitelyTyped/tsd.d.ts" />
import Iridium = require('../index');
import Bluebird = require('bluebird');
import MongoDB = require('mongodb');
Expand All @@ -14,8 +14,14 @@ interface UserDocument {

class User {
_id: string;

static collection = "user";
static schema = {
_id: true
};
}

@Iridium.Collection("userWrapped")
class WrappedUser extends Iridium.Instance<UserDocument, WrappedUser> {
_id: string;
}
Expand All @@ -25,13 +31,8 @@ class IridiumDB extends Iridium.Core {
super({ database: 'test' });
}

User = new Iridium.Model<UserDocument, User>(this,(model, doc) => doc, 'iridium', {
_id: false
});

UserWrapped = new Iridium.Model<UserDocument, WrappedUser>(this, WrappedUser, 'iridiumWrapped', {
_id: false
});
User = new Iridium.Model<UserDocument, User>(this, User);
UserWrapped = new Iridium.Model<UserDocument, WrappedUser>(this, WrappedUser);
}

console.log("Running benchmark with intensity of %d, %d samples", intensity, samples);
Expand Down
10 changes: 10 additions & 0 deletions benchmarks/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"compilerOptions": {
"target": "ES5",
"module": "commonjs",
"experimentalDecorators": true
},
"files": [
"mongodb.ts"
]
}

0 comments on commit e37b56e

Please sign in to comment.