Skip to content

[impl-serde] add a uint bench#209

Merged
dvdplm merged 1 commit into
demi/speedup-and-fix-warningsfrom
impl-serde-bench
Sep 2, 2019
Merged

[impl-serde] add a uint bench#209
dvdplm merged 1 commit into
demi/speedup-and-fix-warningsfrom
impl-serde-bench

Conversation

@ordian

@ordian ordian commented Sep 2, 2019

Copy link
Copy Markdown
Contributor

This PR adds a u256 serde bench to #208.
Demi's brach seems faster by 3-15% on u256 :

u256_to_hex//0          time:   [38.087 ns 38.175 ns 38.271 ns]                            
                        change: [-2.3863% -1.5812% -0.9421%] (p = 0.00 < 0.05)
                        Change within noise threshold.
Found 3 outliers among 100 measurements (3.00%)
  1 (1.00%) high mild
  2 (2.00%) high severe
u256_to_hex//100        time:   [40.901 ns 40.992 ns 41.087 ns]                              
                        change: [-12.317% -11.367% -10.697%] (p = 0.00 < 0.05)
                        Performance has improved.
Found 16 outliers among 100 measurements (16.00%)
  8 (8.00%) low mild
  6 (6.00%) high mild
  2 (2.00%) high severe
u256_to_hex//4294967295 time:   [45.961 ns 46.160 ns 46.459 ns]                                     
                        change: [-15.873% -15.432% -14.964%] (p = 0.00 < 0.05)
                        Performance has improved.
Found 4 outliers among 100 measurements (4.00%)
  2 (2.00%) high mild
  2 (2.00%) high severe
u256_to_hex//18446744073709551615                                                                            
                        time:   [52.170 ns 52.283 ns 52.404 ns]
                        change: [-10.915% -10.565% -10.202%] (p = 0.00 < 0.05)
                        Performance has improved.
Found 5 outliers among 100 measurements (5.00%)
  4 (4.00%) high mild
  1 (1.00%) high severe
u256_to_hex//340282366920938463463374607431768211455                                                                            
                        time:   [66.595 ns 66.722 ns 66.844 ns]
                        change: [-9.9015% -9.6131% -9.3351%] (p = 0.00 < 0.05)
                        Performance has improved.
u256_to_hex//25108406941546723056364004793593481054836439088298861789185                                                                            
                        time:   [86.697 ns 86.972 ns 87.321 ns]
                        change: [-3.4843% -2.8598% -2.1879%] (p = 0.00 < 0.05)
                        Performance has improved.
Found 7 outliers among 100 measurements (7.00%)
  2 (2.00%) high mild
  5 (5.00%) high severe

@dvdplm dvdplm merged commit f4b015f into demi/speedup-and-fix-warnings Sep 2, 2019
@dvdplm dvdplm deleted the impl-serde-bench branch September 2, 2019 10:10
Demi-Marie added a commit that referenced this pull request Sep 3, 2019
)

* Speed up hex serialization and fix warnings

This uses unsafe code (with a proof of safety) to speed up
serialization.  It also fixes a warning due to a deprecated `...` range
pattern.

* [impl-serde] add a uint bench (#209)

* Apply suggestions from code review

Co-Authored-By: Andronik Ordian <[email protected]>

* Support Serde `with`

* Make the comment less alarming

Deserializing an unbounded, untrusted input stream is generally a DoS
vulnerability anyway, even with Serde.  So this is not normally
exploitable.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants