From 9922b0ccf938cd8b4738a34f601588cc93110f4a Mon Sep 17 00:00:00 2001 From: MITSUNARI Shigeo Date: Sat, 27 Jan 2018 23:09:32 +0900 Subject: [PATCH] add benchmark of Firefox and Safari --- Makefile | 8 ++++++-- readme.md | 21 ++++++++++++--------- 2 files changed, 18 insertions(+), 11 deletions(-) diff --git a/Makefile b/Makefile index 76f45b9..241d2f7 100644 --- a/Makefile +++ b/Makefile @@ -234,11 +234,15 @@ endif emcc -o $@ src/fp.cpp src/she_c256.cpp $(EMCC_OPT) -s TOTAL_MEMORY=67108864 ../mcl-wasm/mcl_c.js: src/fp.cpp src/bn_c256.cpp include/mcl/bn.h Makefile - emcc -o $@ src/fp.cpp src/bn_c256.cpp $(EMCC_OPT) + emcc -o $@ src/fp.cpp src/bn_c256.cpp $(EMCC_OPT) -DMCL_MAX_BIT_SIZE=256 ../mcl-wasm/mcl_c512.js: src/fp.cpp src/bn_c512.cpp include/mcl/bn.h Makefile emcc -o $@ src/fp.cpp src/bn_c512.cpp $(EMCC_OPT) -DMCL_MAX_BIT_SIZE=512 +mcl-wasm: + $(MAKE) ../mcl-wasm/mcl_c.js + $(MAKE) ../mcl-wasm/mcl_c512.js + clean: $(RM) $(MCL_LIB) $(MCL_SLIB) $(BN256_LIB) $(BN256_SLIB) $(BN384_LIB) $(BN384_SLIB) $(BN512_LIB) $(BN512_SLIB) $(OBJ_DIR)/*.o $(OBJ_DIR)/*.d $(EXE_DIR)/*.exe $(GEN_EXE) $(ASM_OBJ) $(LIB_OBJ) $(BN256_OBJ) $(BN384_OBJ) $(BN512_OBJ) $(LLVM_SRC) $(FUNC_LIST) src/*.ll @@ -254,7 +258,7 @@ install: lib/libmcl.a lib/libmcl$(SHARE_BASENAME_SUF).$(LIB_SUF) $(MKDIR) $(PREFIX)/lib cp -a lib/libmcl.a lib/libmcl$(SHARE_BASENAME_SUF).$(LIB_SUF) $(PREFIX)/lib/ -.PHONY: test +.PHONY: test mcl-wasm # don't remove these files automatically .SECONDARY: $(addprefix $(OBJ_DIR)/, $(ALL_SRC:.cpp=.o)) diff --git a/readme.md b/readme.md index cff8797..026f172 100644 --- a/readme.md +++ b/readme.md @@ -51,15 +51,18 @@ cmake -DARITH=x64-asm-254 -DFP_PRIME=254 -DFPX_METHD="INTEG;INTEG;LAZYR" -DPP_ME ``` ## Higher-bit BN curve benchmark by mcl -* Benchmark on Kaby Lake Core i7-7700(3.6GHz) - * `test/bn_test.cpp` for CurveFpBN254BNb - * `test/bn512_test.cpp` for CurveFp382_1 and CurveFp461 - -paramter | x64(msec)| -----------------|------------| -CurveFpBN254BNb | 0.29| -CurveFp382_1 | 0.95| -CurveFp461 | 2.16| +paramter | x64| Firefox on x64|Safari on iPhone7| +----------------|-----|---------------|-----------------| +CurveFpBN254BNb | 0.29| 2.48| 4.78| +CurveFp382_1 | 0.95| 7.91| 11.74| +CurveFp462 | 2.16| 14.73| 22.77| + +* x64 : 'Kaby Lake Core i7-7700(3.6GHz)'. +* Firefox : 64-bit version 58. +* iPhone7 : iOS 11.2.1. +* CurveFpBN254BNb is by `test/bn_test.cpp`. +* CurveFp382_1 and CurveFp462 are by `test/bn512_test.cpp`. +* All the timings are given in ms(milliseconds). # Installation Requirements