zoukankan      html  css  js  c++  java
  • 使用JWT的RSA256加密做为用户认证, 测试性能

    http://www.giantflyingsaucer.com/blog/?p=5994


    使用JWT的token认证,防止别人知道了接口后,随意调用,但是发现
    stepping : 4 microcode : 0x428 cpu MHz : 2600.062 cache size : 20480 KB physical id : 0 siblings : 1 core id : 0 cpu cores : 1 apicid : 0 initial apicid : 0 fpu : yes fpu_exception : yes cpuid level : 13 wp : yes flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat clflush mmx fxsr sse sse2 ht syscall nx rdtscp lm constant_tsc rep_good nopl pni ssse3 cx16 sse4_1 sse4_2 popcnt aes hypervisor lahf_lm bogomips : 5200.12 clflush size : 64 cache_alignment : 64 address sizes : 46 bits physical, 48 bits virtual

    使用 go test -test.bench=".*" -v 命令测试,发现加密的挺耗时间的
    goos: linux goarch: amd64 pkg: github.com/KerryJava/goserver Benchmark_TimeConsumingOrm 5000 265224 ns/op Benchmark_TimeConsumingOrm 5000 248941 ns/op Benchmark_TimeConsumingOrm 10000 245728 ns/op Benchmark_TimeConsumingOrm 5000 268391 ns/op Benchmark_TimeConsumingOrm 5000 247001 ns/op Benchmark_TimeConsumingFunctionRawQuery 10000 215219 ns/op Benchmark_TimeConsumingFunctionRawQuery 10000 213085 ns/op Benchmark_TimeConsumingFunctionRawQuery 10000 210200 ns/op Benchmark_TimeConsumingFunctionRawQuery 10000 209737 ns/op Benchmark_TimeConsumingFunctionRawQuery 10000 209695 ns/op Benchmark_TimeConsumingFunctionRawQueryPrepare 20000 65998 ns/op Benchmark_TimeConsumingFunctionRawQueryPrepare 20000 66214 ns/op Benchmark_TimeConsumingFunctionRawQueryPrepare 20000 67460 ns/op Benchmark_TimeConsumingFunctionRawQueryPrepare 20000 67988 ns/op Benchmark_TimeConsumingFunctionRawQueryPrepare 20000 67424 ns/op Benchmark_JWTRSA256Sign 300 4128990 ns/op Benchmark_JWTRSA256Sign 300 4119935 ns/op Benchmark_JWTRSA256Sign 300 4175446 ns/op Benchmark_JWTRSA256Sign 300 4121553 ns/op Benchmark_JWTRSA256Sign 300 4137870 ns/op Benchmark_JWTRSA256Decode 10000 139202 ns/op Benchmark_JWTRSA256Decode 10000 138939 ns/op Benchmark_JWTRSA256Decode 10000 139415 ns/op Benchmark_JWTRSA256Decode 10000 139179 ns/op Benchmark_JWTRSA256Decode 10000 137128 ns/op PASS ok github.com/KerryJava/goserver 43.983s
  • 相关阅读:
    如何给远程主机开启mysql远程登录权限
    Session机制详解
    CentOS 下PHP的卸载
    PHP实现执行定时任务的几种思路详解
    容易产生错误的where条件
    php超时任务处理
    (转载)Android项目tab类型主界面总结
    使用xutils发送POST请求,携带json和图片二进制文件数据获取服务器端返回json数据
    Android开发中常见错误
    (转载)Android显示原理简介
  • 原文地址:https://www.cnblogs.com/studyNT/p/7604335.html
Copyright © 2011-2022 走看看