Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
public
/
sequelize
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
不要怂,就是干,撸起袖子干!
Commit 27b50657
authored
Sep 14, 2010
by
Sascha Depold
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of github.com:sdepold/sequelize
2 parents
a9f632e7
e92dd1e6
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
0 deletions
examples/Performance/app.js
examples/Performance/app.js
0 → 100644
View file @
27b5065
var
Sequelize
=
require
(
__dirname
+
"/../../lib/sequelize/Sequelize"
).
Sequelize
,
sequelize
=
new
Sequelize
(
"sequelize_test"
,
"root"
,
null
,
{
disableLogging
:
true
})
var
Person
=
sequelize
.
define
(
'person'
,
{
name
:
Sequelize
.
STRING
})
Sequelize
.
chainQueries
([{
drop
:
sequelize
},
{
sync
:
sequelize
}],
function
()
{
var
start
=
Date
.
now
(),
count
=
10000
,
queries
=
[]
for
(
var
i
=
0
;
i
<
count
;
i
++
)
{
var
p
=
new
Person
({
name
:
'someone'
})
queries
.
push
({
save
:
p
})
}
Sequelize
.
Helper
.
log
(
"Begin to save "
+
count
+
" items!"
)
Sequelize
.
chainQueries
(
queries
,
function
()
{
Sequelize
.
Helper
.
log
(
"Saving "
+
count
+
" items took: "
+
(
Date
.
now
()
-
start
)
+
"ms"
)
start
=
Date
.
now
()
Sequelize
.
Helper
.
log
(
"Will now read them from the database:"
)
Person
.
findAll
(
function
(
persons
)
{
Sequelize
.
Helper
.
log
(
"Reading "
+
persons
.
length
+
" items took: "
+
(
Date
.
now
()
-
start
)
+
"ms"
)
})
})
})
\ No newline at end of file
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment