added new faster version of storeHudCache routine, storeHudCache2

Set the fastStoreHudCache variable to True to test this out.
In the best case it only does one DB operation (update), if
this fails because the record does not exist it does an insert.
This commit is contained in:
sqlcoder
2009-01-03 19:55:54 +00:00
parent cc31f86269
commit ab1e8cf670
2 changed files with 185 additions and 2 deletions
+16 -2
View File
@@ -22,6 +22,12 @@ from time import time
import fpdb_simple
MYSQL_INNODB=2
PGSQL=3
SQLITE=4
fastStoreHudCache=False # set this to True to test the new storeHudCache routine
saveActions=True # set this to False to avoid storing action data
# Pros: speeds up imports
# Cons: no action data is saved, so you need to keep the hand histories
@@ -68,7 +74,11 @@ def ring_holdem_omaha(backend, db, cursor, base, category, site_hand_no, gametyp
backend, db, cursor, category, hands_id, player_ids, start_cashes
, positions, card_values, card_suits, winnings, rakes, seatNos)
t4 = time()
fpdb_simple.storeHudCache(cursor, base, category, gametype_id, player_ids, hudImportData)
#print "ring holdem, backend=%d" % backend
if fastStoreHudCache:
fpdb_simple.storeHudCache2(backend, cursor, base, category, gametype_id, player_ids, hudImportData)
else:
fpdb_simple.storeHudCache(cursor, base, category, gametype_id, player_ids, hudImportData)
t5 = time()
fpdb_simple.store_board_cards(cursor, hands_id, board_values, board_suits)
t6 = time()
@@ -100,7 +110,11 @@ def tourney_holdem_omaha(backend, db, cursor, base, category, siteTourneyNo, buy
backend, db, cursor, category, hands_id, player_ids, start_cashes, positions
, card_values, card_suits, winnings, rakes, seatNos, tourneys_players_ids)
fpdb_simple.storeHudCache(cursor, base, category, gametype_id, player_ids, hudImportData)
#print "tourney holdem, backend=%d" % backend
if fastStoreHudCache:
fpdb_simple.storeHudCache2(backend, cursor, base, category, gametype_id, player_ids, hudImportData)
else:
fpdb_simple.storeHudCache(cursor, base, category, gametype_id, player_ids, hudImportData)
fpdb_simple.store_board_cards(cursor, hands_id, board_values, board_suits)