[Factor-talk] sqlite performance question

2011-04-21 Thread Tadhg O'Meara
It takes about 6 seconds to insert 100 records into a sqlite db on my Linux x64 system. Is sqlite normally that slow? Thanks, Tadhg Here is the code I used: USING: db db.sqlite db.tuples db.types ; TUPLE: sqltest id ; sqltest SQLTEST { { id ID +db-assigned-id+ } } define-persistent :

Re: [Factor-talk] sqlite performance question

2011-04-21 Thread Andrey Onymov
Because sqlite implicitly starts a new transaction for each insert. Modify it to wrap all inserts in single transaction and see the difference, like this: : insert-test ( -- ) [ sqltest recreate-table begin-transaction 100 [ sqltest new

Re: [Factor-talk] sqlite performance question

2011-04-21 Thread Andrey Onymov
Oh, realized there is with-transaction word only after sending the message. So it becomes : insert-test ( -- ) [ sqltest recreate-table [ 100 [ sqltest new insert-tuple ] times ] with-transaction ] with-sqltest-db ; On Fri, 22 Apr 2011 03:52:46

Re: [Factor-talk] sqlite performance question

2011-04-21 Thread Tadhg O'Meara
That's great. It takes 0.3 seconds now. Thanks for the help. On 21 April 2011 22:59, Andrey Onymov anonym...@gmail.com wrote: Oh, realized there is with-transaction word only after sending the message. So it becomes : insert-test ( -- )          [              sqltest recreate-table