跳至主要內容

性能对比

大约 3 分钟

性能对比

此页比较了 Gorse 不同数据库后端的性能表现。

RESTful APIs

在对 RESTful API 进行基准测试之前,应首先配置好开发环境。然后,将工作目录更改为server并运行基准测试脚本:

cd server
bash bench_test.sh --cache redis --data mysql
  • cache参数可以是redismysqlpostgresmongodb之一。
  • cache参数可以是redismysqlpostgresmongodb之一。

基准测试结果如下(以毫秒为单位):

数据库选型[1]
插入用户信息1.392.601.330.4517.974.030.41
修改用户信息1.430.6710.560.4419.554.490.41
获取用户信息0.280.282.210.300.300.300.20
批量插入10条用户信息1.482.211.471.0021.594.510.92
批量插入100条用户信息2.263.852.485.0117.977.524.95
批量插入1000条用户信息17.5518.979.4151.1352.8440.6046.63
批量获取10条用户信息0.420.342.720.370.440.350.27
批量获取100条用户信息0.810.613.020.830.900.690.63
批量获取1000条用户信息3.572.896.285.204.8110.233.85
删除用户信息11.762.2631.150.4512.272.400.37
插入物品信息13.302.644.610.8938.128.701.22
修改物品信息12.473.1824.691.3041.509.471.80
获取物品信息0.290.303.150.210.370.370.26
批量插入10条物品信息10.722.985.021.0918.327.572.70
批量插入100条物品信息11.425.196.834.5046.6715.0413.01
批量插入1000条物品信息38.7629.4020.5639.57454.2791.44101.66
批量获取10条物品信息0.390.403.640.320.490.480.31
批量获取100条物品信息0.920.954.100.851.221.150.87
批量获取1000条物品信息5.8413.9310.576.657.715.856.42
删除物品信息10.423.3927.151.0625.006.151.73
插入物品类别11.232.344.810.5721.024.920.71
删除物品类别0.652.474.780.601.032.870.64
批量插入10条反馈(覆盖写)10.093.085.672.2831.268.332.65
批量插入100条反馈(覆盖写)16.628.598.1914.4353.5020.4817.79
批量插入1000条反馈(覆盖写)56.3957.6421.36105.29185.60102.84148.21
批量插入10条反馈11.253.624.681.9332.907.962.63
批量插入100条反馈15.038.547.5011.4356.5016.5417.32
批量插入1000条反馈62.5258.0223.98103.05152.69121.93153.70
批量获取10条反馈0.350.493.190.290.430.450.28
批量获取100条反馈0.630.883.560.700.850.820.70
批量获取1000条反馈3.112.989.794.564.262.974.78
获取用户项目反馈0.310.332.630.230.390.370.23
删除用户项反馈10.102.0012.800.2410.932.250.28
获取用户反馈0.320.312.680.260.380.340.23
获取物品反馈0.310.312.500.220.380.350.22
获取10条推荐缓存0.260.290.310.270.680.630.44
获取100条推荐缓存0.500.480.600.493.051.301.25
获取1000条推荐缓存2.482.483.202.67119.3313.808.25
获取10条离线推荐0.350.380.390.340.930.760.58
获取100条离线推荐0.590.600.730.581.981.491.43
获取1000条离线推荐2.832.843.732.8714.695.117.89
获取10条最新推荐0.690.713.200.611.471.230.91
获取100条最新推荐1.040.933.891.132.821.692.21
获取1000条最新推荐4.613.5310.455.1420.445.459.37
获取10条基于相似物品推荐2.212.215.861.946.755.103.79
获取100条基于相似物品推荐4.353.869.753.8721.5310.0810.81
获取1000条基于相似物品推荐23.6521.5936.0422.25183.7857.0259.73

  1. 单元格中第一个logo代表数据存储的数据库,第二个logo代表缓存存储的数据库。 ↩︎