tafia / quick-protobuf

A rust implementation of protobuf parser
MIT License
446 stars 82 forks source link

chore: upgrade rand #206

Open FauxFaux opened 2 years ago

FauxFaux commented 2 years ago

Upgrade rand in perftest.

They've made SmallRng have a different length seed on different platforms, which is .. an odd choice. Instead of messing around with generating a seed, I've taken their recommendation and switched to a specific implementation (the one SmallRng uses in 0.8 anyway), which uses a bigger seed.

Follows #205 so the CI will work.

With lto and RUSTFLAGS='-C target-cpu=native' on my i7-8700K:

     Running `target/release/perftest 10000000`
         labels   rust-protobuf  quick-protobuf           prost      quick/rust      prost/rust
                        ns/iter         ns/iter         ns/iter               %               %

test1
          write              35              10               9            71.4            74.3
           read              28              22              16            21.4            42.9
    read no vec              20              17              12            15.0            40.0
     read reuse              20                              NA              NA

test_repeated_bool
          write              40              13              10            67.5            75.0
           read              67              53              53            20.9            20.9
    read no vec              43              35              34            18.6            20.9
     read reuse              29                              NA              NA

test_repeated_packed_int32
          write              55              27              21            50.9            61.8
           read              89              79              70            11.2            21.3
    read no vec              63              58              51             7.9            19.0
     read reuse              34                              NA              NA

test_repeated_messages
          write             125              80             115            36.0             8.0
           read             666             509             494            23.6            25.8
    read no vec             186             167             144            10.2            22.6
     read reuse              92                              NA              NA

test_optional_messages
          write             111              56              74            49.5            33.3
           read             250             143             130            42.8            48.0
    read no vec             143             115              96            19.6            32.9
     read reuse              86                              NA              NA

test_strings
          write              56              25              22            55.4            60.7
           read             134              69             155            48.5           -15.7
    read no vec              93              48             124            48.4           -33.3
     read reuse              59                              NA              NA

test_small_bytearrays
          write             215             158             189            26.5            12.1
           read             255             103             291            59.6           -14.1
    read no vec             111              31             142            72.1           -27.9
     read reuse             103                              NA              NA

test_large_bytearrays
          write           14141           13895           13575             1.7             4.0
           read           14018            4557           16353            67.5           -16.7
    read no vec            6246              46            7499            99.3           -20.1
     read reuse            7246                              NA              NA
Also (not performance related but fun to know) - Rpc test was successful!