Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Add another benchmark to check performance when receiving. many rows.

commit e0a6b58232576686ea5d8c5f3a45cd68202d5bfd 1 parent e608ef6
@arthurschreiber arthurschreiber authored
Showing with 22 additions and 0 deletions.
  1. +22 −0 benchmarks/benchmarks.coffee
View
22 benchmarks/benchmarks.coffee
@@ -1,6 +1,28 @@
{Request, TYPES} = require "../src/tedious"
+async = require "async"
module.exports =
+ "large number of rows":
+ setup: (connection, cb) ->
+ request = new Request "CREATE TABLE #benchmark ([id] int IDENTITY(1,1), [name] nvarchar(100), [description] nvarchar(max))", (err) ->
+ return cb(err) if err
+
+ async.timesSeries 10000, ((n, next) ->
+ request = new Request "INSERT INTO #benchmark ([name], [description]) VALUES (@name, @description)", next
+ request.addParameter("name", TYPES.NVarChar, "Row " + n)
+ request.addParameter("description", TYPES.NVarChar, "Example Test Description for Row " + n)
+ connection.execSql(request)
+ ), cb
+
+ connection.execSqlBatch(request)
+
+ exec: (connection, cb) ->
+ request = new Request "SELECT * FROM #benchmark", cb
+ connection.execSql(request)
+
+ teardown: (connection, cb) ->
+ request = new Request "DROP TABLE #benchmark", cb
+ connection.execSqlBatch(request)
"nvarchar (small)":
setup: (connection, cb) ->
Please sign in to comment.
Something went wrong with that request. Please try again.