> c.execute("INSERT INTO player VALUES
> ('Player%d',%f,NULL)"%(i,random.random()))
>real 5m29.157s
>user 5m22.137s
>sys 0m5.457s
Not that it makes much of a difference since this is only for "testing" but
using:
c.execute('INSERT INTO player VALUES (?,?,NULL);', ('Player%d' % i,
random.random()))
is 500% faster since you are using the same statement )prepared once) and only
changing bindings rather than having to prepare 10000000 different statements.
TimeThis : Command Line : createPlayer.py
TimeThis : Start Time : Sun Aug 24 00:12:41 2014
TimeThis : End Time : Sun Aug 24 00:14:02 2014
TimeThis : Elapsed Time : 00:01:20.296
_______________________________________________
sqlite-users mailing list
[email protected]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users