sqlite
これを実行しました。これは、 5000行を挿入することを除いて、基本的にドキュメントの例です。
import time
import sqlite3
conn = sqlite3.connect('example')
c = conn.cursor()
# Create table
c.execute('''create table stocks
(date text, trans text, symbol text, qty real, price real)''')
print time.time()
for i in xrange(5000):
# Insert a row of data
c.execute("""insert into stocks
values ('2006-01-05','BUY','RHAT',100,35.14)""")
# We can also close the cursor if we are done with it
# Save (commit) the changes
conn.commit()
c.close()
print time.time()
私のラップトップでは10分の4秒で。
その時間の大部分はデータベースのコミットに費やされます。データベースに頻繁にコミットしない限り(数秒に1回以下)、SQLiteは1秒あたり5000票の負荷を簡単に処理できます。
1分あたり4000票は、すべての投票の後にコミットしない限り、それを段階的に行うことはありません。