CodePudding user response:
Seems evaluation should have this effectCodePudding user response:
Test method is a simple circular insert? It's convenient for provide the methodCodePudding user response:
Right, it is a simple loop insert,CodePudding user response:
I found the rs test is slower than the single, to more than double the timeimport time
The from pymongo import MongoClient
Def test (rows, url) :
With MongoClient (url) as the client:
Coll=client. The test. The test
Coll. Drop ()
Starttime=time. Time ()
For I in range (rows) :
Re=coll. Insert (dict (_id=I, time=time. The time (), data=https://bbs.csdn.net/topics/(time, ctime ()) * 1024 * 10))
Print (time. Time () - starttime)
CodePudding user response:
Four or five seconds, I insert ten thousand data is not a simple cycle, there is a complex business judgment... You didn't do is index?