• For an Intel(R) Core(TM) i7-6820HQ CPU @ 2.70GHz I got: option 1 is the fastest, followed by options 2 and 8 for regular to big payloads, but for very big payloads then option 2 turns the fastest. However, since this lib is primarily oriented to sign data for cookies, option 1 would be the optimal one (if correct!).

    --- Payload size: 100
    
    option_1
    1.88 µs ± 9.82 ns per loop (mean ± std. dev. of 10 runs, 1000000 loops each)
    
    option_2
    2.35 µs ± 46.4 ns per loop (mean ± std. dev. of 10 runs, 100000 loops each)
    
    option_3
    3.84 µs ± 26.5 ns per loop (mean ± std. dev. of 10 runs, 100000 loops each)
    
    option_4
    4.81 µs ± 33.5 ns per loop (mean ± std. dev. of 10 runs, 100000 loops each)
    
    option_5
    4.32 µs ± 17.7 ns per loop (mean ± std. dev. of 10 runs, 100000 loops each)
    
    option_6
    4.04 µs ± 28.3 ns per loop (mean ± std. dev. of 10 runs, 100000 loops each)
    
    option_7
    3.7 µs ± 27.8 ns per loop (mean ± std. dev. of 10 runs, 100000 loops each)
    
    option_8
    2.36 µs ± 31.8 ns per loop (mean ± std. dev. of 10 runs, 100000 loops each)
    
    Option               | Best Abs Time | Measure | Comparison
    -------------------- | ------------- | ------- | ---------------------------
    option_1             |       1.86 us |    √    | baseline 
    option_2             |        2.3 us |    ⚠    |  23% (slower than baseline)
    option_3             |        3.8 us |    √    | 104% (slower than baseline)
    option_4             |       4.75 us |    √    | 155% (slower than baseline)
    option_5             |       4.29 us |    √    | 130% (slower than baseline)
    option_6             |          4 us |    √    | 115% (slower than baseline)
    option_7             |       3.67 us |    √    |  97% (slower than baseline)
    option_8             |       2.34 us |    √    |  25% (slower than baseline)
    
    --- Payload size: 10000
    
    option_1
    6.33 µs ± 41.2 ns per loop (mean ± std. dev. of 10 runs, 100000 loops each)
    
    option_2
    6.43 µs ± 34 ns per loop (mean ± std. dev. of 10 runs, 100000 loops each)
    
    option_3
    8.04 µs ± 26.9 ns per loop (mean ± std. dev. of 10 runs, 100000 loops each)
    
    option_4
    9.11 µs ± 73.6 ns per loop (mean ± std. dev. of 10 runs, 100000 loops each)
    
    option_5
    8.59 µs ± 40.1 ns per loop (mean ± std. dev. of 10 runs, 100000 loops each)
    
    option_6
    8.28 µs ± 45.2 ns per loop (mean ± std. dev. of 10 runs, 100000 loops each)
    
    option_7
    8.02 µs ± 33.7 ns per loop (mean ± std. dev. of 10 runs, 100000 loops each)
    
    option_8
    6.63 µs ± 41 ns per loop (mean ± std. dev. of 10 runs, 100000 loops each)
    
    Option               | Best Abs Time | Measure | Comparison
    -------------------- | ------------- | ------- | ---------------------------
    option_1             |       6.29 us |    √    | baseline 
    option_2             |       6.37 us |    √    |   1% (slower than baseline)
    option_3             |          8 us |    √    |  27% (slower than baseline)
    option_4             |          9 us |    √    |  43% (slower than baseline)
    option_5             |       8.53 us |    √    |  35% (slower than baseline)
    option_6             |       8.19 us |    √    |  30% (slower than baseline)
    option_7             |       7.97 us |    √    |  26% (slower than baseline)
    option_8             |       6.58 us |    √    |   4% (slower than baseline)
    
    --- Payload size: 15000
    
    option_1
    10.1 µs ± 190 ns per loop (mean ± std. dev. of 10 runs, 100000 loops each)
    
    option_2
    9.54 µs ± 78.3 ns per loop (mean ± std. dev. of 10 runs, 100000 loops each)
    
    option_3
    11.2 µs ± 35.5 ns per loop (mean ± std. dev. of 10 runs, 100000 loops each)
    
    option_4
    12.1 µs ± 49.6 ns per loop (mean ± std. dev. of 10 runs, 100000 loops each)
    
    option_5
    11.6 µs ± 114 ns per loop (mean ± std. dev. of 10 runs, 100000 loops each)
    
    option_6
    11.3 µs ± 25.5 ns per loop (mean ± std. dev. of 10 runs, 100000 loops each)
    
    option_7
    11.1 µs ± 66 ns per loop (mean ± std. dev. of 10 runs, 100000 loops each)
    
    option_8
    9.71 µs ± 107 ns per loop (mean ± std. dev. of 10 runs, 100000 loops each)
    
    Option               | Best Abs Time | Measure | Comparison
    -------------------- | ------------- | ------- | ---------------------------
    option_1             |       9.77 us |    ⚠    | baseline 
    option_2             |       9.42 us |    √    |  -4% (faster than baseline)
    option_3             |       11.1 us |    √    |  13% (slower than baseline)
    option_4             |       12.1 us |    √    |  23% (slower than baseline)
    option_5             |       11.5 us |    √    |  17% (slower than baseline)
    option_6             |       11.3 us |    √    |  15% (slower than baseline)
    option_7             |       11.1 us |    √    |  13% (slower than baseline)
    option_8             |        9.6 us |    √    |  -2% (faster than baseline)
    
    --- Payload size: 100000
    
    option_1
    34.1 µs ± 630 ns per loop (mean ± std. dev. of 10 runs, 10000 loops each)
    
    option_2
    31.2 µs ± 669 ns per loop (mean ± std. dev. of 10 runs, 10000 loops each)
    
    option_3
    33.4 µs ± 413 ns per loop (mean ± std. dev. of 10 runs, 10000 loops each)
    
    option_4
    34 µs ± 365 ns per loop (mean ± std. dev. of 10 runs, 10000 loops each)
    
    option_5
    33.7 µs ± 384 ns per loop (mean ± std. dev. of 10 runs, 10000 loops each)
    
    option_6
    33.2 µs ± 331 ns per loop (mean ± std. dev. of 10 runs, 10000 loops each)
    
    option_7
    33.1 µs ± 479 ns per loop (mean ± std. dev. of 10 runs, 10000 loops each)
    
    option_8
    31.3 µs ± 203 ns per loop (mean ± std. dev. of 10 runs, 10000 loops each)
    
    Option               | Best Abs Time | Measure | Comparison
    -------------------- | ------------- | ------- | ---------------------------
    option_1             |       33.6 us |    ⚠    | baseline 
    option_2             |       30.6 us |    ⚠    |  -9% (faster than baseline)
    option_3             |       33.1 us |    √    |  -2% (faster than baseline)
    option_4             |       33.6 us |    √    |   0% 
    option_5             |         33 us |    √    |  -2% (faster than baseline)
    option_6             |       32.7 us |    √    |  -3% (faster than baseline)
    option_7             |       32.3 us |    √    |  -4% (faster than baseline)
    option_8             |         31 us |    √    |  -8% (faster than baseline)
    Edited by HacKan
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment