aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnthony Wang2023-05-30 14:49:38 -0500
committerAnthony Wang2023-05-30 14:49:38 -0500
commit9f316d8e6ea52518316dec0a320d51c8a866446e (patch)
tree08748e95bc2432f5c69996c671aa0ea60a2ae703
parentfe80a19358fb0c16ed0db1dbc793631e40540420 (diff)
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!
-rw-r--r--test.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/test.py b/test.py
new file mode 100644
index 0000000..821bf62
--- /dev/null
+++ b/test.py
@@ -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()