Why is SQLite faster than Redis in this simple benchmark?

前端 未结 4 965
予麋鹿
予麋鹿 2021-01-30 17:16

I have done simple performance test on my local machine, this is python script:

import redis
import sqlite3
import time

data = {}
N = 100000

for i in xrange(N)         


        
4条回答
  •  自闭症患者
    2021-01-30 17:54

    Just noticed that you did not pipeline the commit for redis. Using piplines the time reduces:

    [---Testing SQLITE---]

    [Total time of sql: 0.669369935989]

    [---Testing REDIS---]

    [Total time of redis: 2.39369487762]

提交回复
热议问题