前天发布了fastupload 0.2.3,没想到受到了大家的关注,下载量急剧上升。首先说明一下,写fastupload纯粹是个业余爱好,拿出来几行好的代码与大家分享,后来测试了一下,确实比Apache上的common file upload要快很多。放出来两组测试数据与测试代码,限于时间与水平关系,这里不做分析与评价,只看具体数据。
测试环境还是本人的小笔记本,与第一回里测试里所用的是一模一样的,测试代码有兴趣的可以从文后的附件中下载,有兴趣的读者可以亲自测试一下。
第一组,上传三个图片,分别是348k、331k、368k,fastupload的测试结果如下
common file upload测试结果如下,单位也是ms
第二组测试样本文件,27020246k, 26035095k, 26886326k的RAW照片, fastupload测试结果如下,单位ms
common file upload结果如下, 单位ms,其中有一次失败。
测试环境还是本人的小笔记本,与第一回里测试里所用的是一模一样的,测试代码有兴趣的可以从文后的附件中下载,有兴趣的读者可以亲自测试一下。
第一组,上传三个图片,分别是348k、331k、368k,fastupload的测试结果如下
//单位 ms
cost: 36
cost: 61
cost: 6
cost: 6
cost: 7
cost: 8
cost: 6
cost: 6
cost: 5
cost: 8
cost: 8
cost: 7
cost: 7
cost: 6
cost: 7
cost: 7
cost: 6
cost: 7
cost: 6
cost: 7
cost: 6
cost: 6
cost: 30
cost: 41
cost: 8
cost: 8
cost: 7
cost: 6
cost: 7
common file upload测试结果如下,单位也是ms
Apache Common File Upload costs: 121
Apache Common File Upload costs: 11
Apache Common File Upload costs: 13
Apache Common File Upload costs: 12
Apache Common File Upload costs: 8
Apache Common File Upload costs: 10
Apache Common File Upload costs: 9
Apache Common File Upload costs: 12
Apache Common File Upload costs: 8
Apache Common File Upload costs: 9
Apache Common File Upload costs: 8
Apache Common File Upload costs: 8
Apache Common File Upload costs: 9
Apache Common File Upload costs: 11
Apache Common File Upload costs: 13
Apache Common File Upload costs: 10
Apache Common File Upload costs: 12
Apache Common File Upload costs: 12
Apache Common File Upload costs: 9
Apache Common File Upload costs: 12
Apache Common File Upload costs: 8
Apache Common File Upload costs: 15
Apache Common File Upload costs: 10
Apache Common File Upload costs: 10
Apache Common File Upload costs: 8
Apache Common File Upload costs: 10
Apache Common File Upload costs: 9
Apache Common File Upload costs: 10
Apache Common File Upload costs: 10
第二组测试样本文件,27020246k, 26035095k, 26886326k的RAW照片, fastupload测试结果如下,单位ms
cost: 2589
cost: 2021
cost: 2042
cost: 1769
cost: 1872
cost: 2814
cost: 2319
cost: 1934
cost: 1758
cost: 1853
cost: 1993
cost: 1781
cost: 1887
cost: 1856
cost: 1939
cost: 1861
cost: 2572
cost: 1953
cost: 1898
cost: 1973
common file upload结果如下, 单位ms,其中有一次失败。
Apache Common File Upload costs: 2872
Apache Common File Upload costs: 2818
Apache Common File Upload costs: 3264
Apache Common File Upload costs: 2802
Apache Common File Upload costs: 2817
Apache Common File Upload costs: 2621
Apache Common File Upload costs: 2715
Apache Common File Upload costs: 2616
Apache Common File Upload costs: 2757
Apache Common File Upload costs: 2862
Apache Common File Upload costs: 3221
Apache Common File Upload costs: 2767
Apache Common File Upload costs: 2868
Apache Common File Upload costs: 2604
Apache Common File Upload costs: 2696
Apache Common File Upload costs: 2888
org.apache.commons.fileupload.FileUploadBase$IOFileUploadException: Processing of multipart/form-data request failed. Stream ended unexpectedly
.......
... 20 more
Apache Common File Upload costs: 2877
Apache Common File Upload costs: 3020
Apache Common File Upload costs: 2706
Apache Common File Upload costs: 2720