Times are seconds required to store a file.
File size GridFS avg Lobject avg Lobject diff
========== ============== =========== ============
1k 0.0017968 0.0002748 85%
10k 0.00180485 0.0003415 81%
1M 0.00667265 0.00271265 59%
10M 0.04660705 0.0214903 54%
50M 0.22207705 0.1296414 42%
(Courtesy of ministat.)
$ python benchmark-storage.py 1024 20
$ ministat -c99 -w74 gridfs-1k-20.txt lobject-1k-20.txt
x gridfs-1k-20.txt
+ lobject-1k-20.txt
+--------------------------------------------------------------------------+
| + |
| + |
| + |
| + |
| + |
| + |
| ++ |
| ++ |
| ++ + x |
| ++ + x x |
| ++ + + x xxxx x x xx x xx xx x x x|
||__M_A___| |________M_A__________| |
+--------------------------------------------------------------------------+
N Min Max Median Avg Stddev
x 20 0.001297 0.00286 0.0017275 0.0017968 0.000412761
+ 20 0.000199 0.000995 0.000227 0.0002748 0.00017411327
Difference at 99.0% confidence
-0.001522 +/- 0.000271665
-84.7061% +/- 15.1194%
(Student's t, pooled s = 0.00031677)
$ python benchmark-storage.py 10240 20
$ ministat -c99 -w74 gridfs-10k-20.txt lobject-10k-20.txt
x gridfs-10k-20.txt
+ lobject-10k-20.txt
+--------------------------------------------------------------------------+
|+ |
|+ |
|+ + |
|+ ++ + x |
|++++ + x x x |
|+++++++ x x xxxx xxxxx xx x x x|
||_A_| |_______M__A__________| |
+--------------------------------------------------------------------------+
N Min Max Median Avg Stddev
x 20 0.001258 0.00316 0.0017045 0.00180485 0.00042674154
+ 20 0.000253 0.000498 0.0003245 0.0003415 7.8833268e-05
Difference at 99.0% confidence
-0.00146335 +/- 0.000263164
-81.0788% +/- 14.5809%
(Student's t, pooled s = 0.000306857)
$ python benchmark-storage.py 1048576 20
$ ministat -c99 -w74 gridfs-1M-20.txt lobject-1M-20.txt
x gridfs-1M-20.txt
+ lobject-1M-20.txt
+--------------------------------------------------------------------------+
| + |
| + |
| ++ x |
| ++ x |
| ++ x x x |
| ++++ x x x x |
|+++++ ++ + xxx x xxx xxx x|
||_MA_| |______M_A_______| |
+--------------------------------------------------------------------------+
N Min Max Median Avg Stddev
x 20 0.005882 0.010248 0.0064845 0.00667265 0.00093660683
+ 20 0.002418 0.003446 0.0026345 0.00271265 0.0002695611
Difference at 99.0% confidence
-0.00396 +/- 0.000591034
-59.3467% +/- 8.85756%
(Student's t, pooled s = 0.000689165)
$ python benchmark-storage.py 10485760 20
$ ministat -c99 -w74 gridfs-10M-20.txt lobject-10M-20.txt
x gridfs-10M-20.txt
+ lobject-10M-20.txt
+--------------------------------------------------------------------------+
| + |
| + |
| ++ |
| ++ |
| ++ |
| ++ x |
|+++ xxx |
|+++ xxx x |
|++++ xxx x x x xxx x x x|
| A| |___M____A________| |
+--------------------------------------------------------------------------+
N Min Max Median Avg Stddev
x 20 0.042279 0.058557 0.0440435 0.04660705 0.0046465036
+ 20 0.020823 0.022263 0.0215675 0.0214903 0.00034488108
Difference at 99.0% confidence
-0.0251167 +/- 0.00282549
-53.8905% +/- 6.06237%
(Student's t, pooled s = 0.00329461)
$ python benchmark-storage.py 52428800 20
$ ministat -c99 -w74 gridfs-50M-20.txt lobject-50M-20.txt
x gridfs-50M-20.txt
+ lobject-50M-20.txt
+--------------------------------------------------------------------------+
| + |
|++ x |
|++ x |
|++ + + x x x x |
|++ + ++++++++ xxxxxx x xxx x x x x|
| |________A_________| |______M_A_______| |
+--------------------------------------------------------------------------+
N Min Max Median Avg Stddev
x 20 0.201251 0.269507 0.2179865 0.22207705 0.019609101
+ 20 0.10715 0.157961 0.1285205 0.1296414 0.021250329
Difference at 99.0% confidence
-0.0924356 +/- 0.0175349
-41.6232% +/- 7.89584%
(Student's t, pooled s = 0.0204462)
Hey, firstly thank you for the work, this make my work a lot more easier.
But I found something different.
At first I tried the benchmark script, got similar result,
then I add
print
in eachstore
method, but in each test I felt GridFS takes less time than LO.So I searched for something, and tried change
time.clock()
totimeit.default_timer()
:And I ran some benchmark, and got opposite result, from some of my trying, basically GridFS is faster than LO.
There are some different in my environment (DB host, user, password, etc.), and I ran DB in Docker, on my MacBook laptop running macOS, connect with TCP socket not Unix Socket. But it should not be the reason, because with
time.clock()
I got "LO faster".Maybe there is something different on
time.clock()
, not very sure though.