最终实现效果:
- 无版本概念,任何本地文件均可增量升级到最新.服务器不用管理多版本
- 内存小,100M文件升级时只占用500KB内存.
使用流程:
- 制作新版本,上传HTTP File Server.
- Client自动计算差异,下载差异,合并差异.
- done!
#0.起源
最终实现效果:
使用流程:
#0.起源
/* 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; |
/* 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> |
Android手机测试数据 | |
测试文件:460MB | |
源码:见 https://gist.github.com/9468305/97dca7c470ee02a6867c | |
使用场景:需求源于这里 https://gist.github.com/9468305/fa8f1307ea4738225fca | |
测试思路:测试mmap,file io buffer read,OpenMP并行数,对各种数据摘要算法,在不同手机上的性能表现进行统计分析 |