pydis – A redis clone in Python 3 to disprove some falsehoods about performance

I developed pydis in two days to disprove some of the falsehoods about performance and optimisation regarding software and interpreted languages in particular.

Unfortunately many programmers, due to their lack of experience, of some knowledge of computer architecture(s), or of an in-depth understanding of the task they are given, spend countless hours by making life harder for themselves in the name of marginal performance gains, often trading many other conveniences (such as type safety, garbage collection, etc) too.

pydis is < 250 lines of idiomatic Python code, providing a subset of redis’ functionality for which there are official benchmarks, and yet it’s ~60% as fast as Redis measured in number operations per second.

Remember, man-hours are more expensive that cpu-time.

https://github.com/boramalper/pydis

Results

BenchmarkpydisredisRatio
SET301,582379,9440.794
GET264,841455,2370.582
INCR238,670442,4830.539
LPUSH246,867386,4420.639
RPUSH258,845376,7870.687
LPOP297,397355,2760.837
RPOP280,095399,5110.701
SADD223,700416,8420.537
HSET240,649367,9850.654
SPOP285,936442,7470.646
LRANGE (100)26,16299,7030.262
LRANGE (300)9,13521,2110.431
LRANGE (500)5,78814,6490.395
LRANGE (600)4,33910,6590.407
MSET157,963172,2260.917

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.