Add testing script that generates deck DB with 10**8 cards
Starting SDC with this DB takes 5 seconds to load all the weights from disk (it's 1.9GB), but after that it's incredibly fast and responsive. Yay segment trees and overengineering!
This commit is contained in:
parent
fe80a19358
commit
9f316d8e6e
1 changed files with 8 additions and 0 deletions
8
test.py
Normal file
8
test.py
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
import sqlite3
|
||||||
|
|
||||||
|
con = sqlite3.connect("test.db")
|
||||||
|
cur = con.cursor()
|
||||||
|
cur.execute("CREATE TABLE IF NOT EXISTS cards (idx INTEGER PRIMARY KEY, weight INTEGER, key STRING, val STRING)")
|
||||||
|
for i in range(10**8):
|
||||||
|
cur.execute("INSERT INTO cards VALUES(?, ?, ?, ?)", (i, 1, i, i))
|
||||||
|
con.commit()
|
Loading…
Reference in a new issue