##1 准备
##2 安装
| Android手机测试数据 | |
| 测试文件:460MB | |
| 源码:见 https://gist.github.com/9468305/97dca7c470ee02a6867c | |
| 使用场景:需求源于这里 https://gist.github.com/9468305/fa8f1307ea4738225fca | |
| 测试思路:测试mmap,file io buffer read,OpenMP并行数,对各种数据摘要算法,在不同手机上的性能表现进行统计分析 |
| /* Test case for blake2s blake2sp blake2sp_file vs md5 md5_parallel | |
| * Result: md5_parallel is fastest. | |
| * MD5_File() and MD5_File_Parallel(), see https://github.com/9468305/crsync/blob/master/extra/md5.h | |
| */ | |
| #include <stdint.h> | |
| #include <string.h> | |
| #include <stdio.h> | |
| #include <time.h> | |
| #include <sys/timeb.h> |
| /* A really fast parallel blake2s hash for big file. | |
| * | |
| * Usage: Add this into blake2sp-ref.c | |
| */ | |
| #include <sys/stat.h> | |
| int blake2sp_file( const char *filename, uint8_t *out, uint8_t outlen ) | |
| { | |
| memset(out, 0, outlen); | |
| static const size_t buf_len = 8*1024; | |
| struct stat st; |
最终实现效果:
使用流程:
#0.起源