rust-csv icon indicating copy to clipboard operation
rust-csv copied to clipboard

Apply select clippy recommendations

Open jqnatividad opened this issue 3 years ago • 1 comments

The changes show increased performance. Per cargo +nightly bench:

Before:

running 44 tests
test count_game_deserialize_borrowed_bytes ... bench:  14,539,780 ns/iter (+/- 1,014,156) = 185 MB/s
test count_game_deserialize_borrowed_str   ... bench:  12,196,290 ns/iter (+/- 991,195) = 221 MB/s
test count_game_deserialize_owned_bytes    ... bench:  42,523,060 ns/iter (+/- 1,517,257) = 63 MB/s
test count_game_deserialize_owned_str      ... bench:  38,553,340 ns/iter (+/- 1,181,455) = 70 MB/s
test count_game_iter_bytes                 ... bench:  23,294,680 ns/iter (+/- 1,190,281) = 115 MB/s
test count_game_iter_str                   ... bench:  23,949,070 ns/iter (+/- 1,208,276) = 112 MB/s
test count_game_read_bytes                 ... bench:   6,991,485 ns/iter (+/- 668,616) = 386 MB/s
test count_game_read_str                   ... bench:   7,797,670 ns/iter (+/- 687,121) = 346 MB/s
test count_game_serialize_owned_bytes      ... bench:   9,600,710 ns/iter (+/- 643,983) = 229 MB/s
test count_game_serialize_owned_str        ... bench:   9,446,105 ns/iter (+/- 519,573) = 232 MB/s
test count_mbta_deserialize_borrowed_bytes ... bench:   2,823,250 ns/iter (+/- 185,074) = 259 MB/s
test count_mbta_deserialize_borrowed_str   ... bench:   2,257,625 ns/iter (+/- 169,659) = 324 MB/s
test count_mbta_deserialize_owned_bytes    ... bench:   5,082,035 ns/iter (+/- 324,105) = 144 MB/s
test count_mbta_deserialize_owned_str      ... bench:   5,281,560 ns/iter (+/- 327,321) = 138 MB/s
test count_mbta_iter_bytes                 ... bench:   3,095,260 ns/iter (+/- 388,933) = 236 MB/s
test count_mbta_iter_str                   ... bench:   3,240,875 ns/iter (+/- 371,641) = 226 MB/s
test count_mbta_read_bytes                 ... bench:   1,424,600 ns/iter (+/- 141,344) = 514 MB/s
test count_mbta_read_str                   ... bench:   1,551,942 ns/iter (+/- 388,848) = 472 MB/s
test count_mbta_serialize_owned_bytes      ... bench:   1,472,965 ns/iter (+/- 263,059) = 423 MB/s
test count_mbta_serialize_owned_str        ... bench:   1,588,917 ns/iter (+/- 372,758) = 392 MB/s
test count_nfl_deserialize_borrowed_bytes  ... bench:   4,857,900 ns/iter (+/- 711,149) = 282 MB/s
test count_nfl_deserialize_borrowed_str    ... bench:   3,965,005 ns/iter (+/- 778,891) = 346 MB/s
test count_nfl_deserialize_owned_bytes     ... bench:   7,227,075 ns/iter (+/- 734,489) = 190 MB/s
test count_nfl_deserialize_owned_str       ... bench:   7,340,560 ns/iter (+/- 1,043,026) = 187 MB/s
test count_nfl_iter_bytes                  ... bench:   4,199,185 ns/iter (+/- 654,757) = 327 MB/s
test count_nfl_iter_bytes_trimmed          ... bench:   9,283,690 ns/iter (+/- 1,252,915) = 148 MB/s
test count_nfl_iter_str                    ... bench:   4,458,845 ns/iter (+/- 716,089) = 308 MB/s
test count_nfl_iter_str_trimmed            ... bench:  13,712,440 ns/iter (+/- 1,858,349) = 100 MB/s
test count_nfl_read_bytes                  ... bench:   2,311,175 ns/iter (+/- 312,385) = 594 MB/s
test count_nfl_read_str                    ... bench:   2,546,225 ns/iter (+/- 265,648) = 539 MB/s
test count_nfl_serialize_owned_bytes       ... bench:   3,114,977 ns/iter (+/- 452,441) = 438 MB/s
test count_nfl_serialize_owned_str         ... bench:   3,018,252 ns/iter (+/- 630,414) = 452 MB/s
test count_pop_deserialize_borrowed_bytes  ... bench:   5,754,810 ns/iter (+/- 459,856) = 169 MB/s
test count_pop_deserialize_borrowed_str    ... bench:   4,679,315 ns/iter (+/- 1,015,513) = 208 MB/s
test count_pop_deserialize_owned_bytes     ... bench:  10,147,440 ns/iter (+/- 1,076,220) = 96 MB/s
test count_pop_deserialize_owned_str       ... bench:  10,274,970 ns/iter (+/- 2,297,875) = 94 MB/s
test count_pop_iter_bytes                  ... bench:   5,559,180 ns/iter (+/- 732,025) = 175 MB/s
test count_pop_iter_str                    ... bench:   6,982,320 ns/iter (+/- 3,549,741) = 139 MB/s
test count_pop_read_bytes                  ... bench:   2,172,310 ns/iter (+/- 190,009) = 449 MB/s
test count_pop_read_str                    ... bench:   2,600,327 ns/iter (+/- 168,439) = 375 MB/s
test count_pop_serialize_owned_bytes       ... bench:   4,915,925 ns/iter (+/- 2,979,693) = 194 MB/s
test count_pop_serialize_owned_str         ... bench:   5,279,925 ns/iter (+/- 2,416,985) = 180 MB/s
test write_nfl_bytes                       ... bench:   3,216,390 ns/iter (+/- 933,783) = 427 MB/s
test write_nfl_record                      ... bench:   4,258,780 ns/iter (+/- 1,414,154) = 322 MB/s

test result: ok. 0 passed; 0 failed; 0 ignored; 44 measured; 0 filtered out; finished in 242.52s

After:

running 44 tests
test count_game_deserialize_borrowed_bytes ... bench:  14,770,400 ns/iter (+/- 1,097,741) = 182 MB/s
test count_game_deserialize_borrowed_str   ... bench:  10,067,520 ns/iter (+/- 699,392) = 268 MB/s
test count_game_deserialize_owned_bytes    ... bench:  41,178,060 ns/iter (+/- 1,747,181) = 65 MB/s
test count_game_deserialize_owned_str      ... bench:  38,379,620 ns/iter (+/- 1,321,960) = 70 MB/s
test count_game_iter_bytes                 ... bench:  21,470,800 ns/iter (+/- 939,696) = 125 MB/s
test count_game_iter_str                   ... bench:  22,127,560 ns/iter (+/- 1,037,709) = 122 MB/s
test count_game_read_bytes                 ... bench:   5,367,260 ns/iter (+/- 392,894) = 503 MB/s
test count_game_read_str                   ... bench:   6,084,275 ns/iter (+/- 438,639) = 443 MB/s
test count_game_serialize_owned_bytes      ... bench:  10,284,920 ns/iter (+/- 491,791) = 213 MB/s
test count_game_serialize_owned_str        ... bench:  10,289,780 ns/iter (+/- 737,451) = 213 MB/s
test count_mbta_deserialize_borrowed_bytes ... bench:   2,536,260 ns/iter (+/- 195,716) = 289 MB/s
test count_mbta_deserialize_borrowed_str   ... bench:   1,799,412 ns/iter (+/- 169,818) = 407 MB/s
test count_mbta_deserialize_owned_bytes    ... bench:   4,982,455 ns/iter (+/- 251,322) = 147 MB/s
test count_mbta_deserialize_owned_str      ... bench:   5,019,140 ns/iter (+/- 343,655) = 146 MB/s
test count_mbta_iter_bytes                 ... bench:   2,811,905 ns/iter (+/- 173,666) = 260 MB/s
test count_mbta_iter_str                   ... bench:   2,936,045 ns/iter (+/- 160,882) = 249 MB/s
test count_mbta_read_bytes                 ... bench:   1,043,860 ns/iter (+/- 241,591) = 702 MB/s
test count_mbta_read_str                   ... bench:   1,172,485 ns/iter (+/- 132,280) = 625 MB/s
test count_mbta_serialize_owned_bytes      ... bench:   1,469,380 ns/iter (+/- 422,993) = 424 MB/s
test count_mbta_serialize_owned_str        ... bench:   1,447,727 ns/iter (+/- 136,602) = 430 MB/s
test count_nfl_deserialize_borrowed_bytes  ... bench:   3,907,660 ns/iter (+/- 214,971) = 351 MB/s
test count_nfl_deserialize_borrowed_str    ... bench:   3,025,490 ns/iter (+/- 261,374) = 454 MB/s
test count_nfl_deserialize_owned_bytes     ... bench:   6,394,620 ns/iter (+/- 308,618) = 214 MB/s
test count_nfl_deserialize_owned_str       ... bench:   6,477,710 ns/iter (+/- 132,191) = 212 MB/s
test count_nfl_iter_bytes                  ... bench:   3,355,540 ns/iter (+/- 93,544) = 409 MB/s
test count_nfl_iter_bytes_trimmed          ... bench:   8,390,500 ns/iter (+/- 798,159) = 163 MB/s
test count_nfl_iter_str                    ... bench:   3,659,150 ns/iter (+/- 296,592) = 375 MB/s
test count_nfl_iter_str_trimmed            ... bench:  11,958,600 ns/iter (+/- 1,071,455) = 114 MB/s
test count_nfl_read_bytes                  ... bench:   1,712,700 ns/iter (+/- 200,487) = 802 MB/s
test count_nfl_read_str                    ... bench:   1,882,470 ns/iter (+/- 221,367) = 730 MB/s
test count_nfl_serialize_owned_bytes       ... bench:   2,806,687 ns/iter (+/- 266,074) = 486 MB/s
test count_nfl_serialize_owned_str         ... bench:   2,850,285 ns/iter (+/- 270,748) = 478 MB/s
test count_pop_deserialize_borrowed_bytes  ... bench:   4,996,435 ns/iter (+/- 567,427) = 195 MB/s
test count_pop_deserialize_borrowed_str    ... bench:   4,354,690 ns/iter (+/- 368,532) = 224 MB/s
test count_pop_deserialize_owned_bytes     ... bench:   9,589,035 ns/iter (+/- 648,204) = 101 MB/s
test count_pop_deserialize_owned_str       ... bench:   9,734,165 ns/iter (+/- 581,444) = 100 MB/s
test count_pop_iter_bytes                  ... bench:   5,005,190 ns/iter (+/- 553,162) = 194 MB/s
test count_pop_iter_str                    ... bench:   5,453,440 ns/iter (+/- 289,847) = 178 MB/s
test count_pop_read_bytes                  ... bench:   1,707,442 ns/iter (+/- 146,616) = 571 MB/s
test count_pop_read_str                    ... bench:   2,069,595 ns/iter (+/- 169,862) = 471 MB/s
test count_pop_serialize_owned_bytes       ... bench:   4,307,100 ns/iter (+/- 194,371) = 221 MB/s
test count_pop_serialize_owned_str         ... bench:   4,311,505 ns/iter (+/- 142,017) = 221 MB/s
test write_nfl_bytes                       ... bench:   2,616,400 ns/iter (+/- 213,092) = 525 MB/s
test write_nfl_record                      ... bench:   3,426,240 ns/iter (+/- 366,271) = 401 MB/s

test result: ok. 0 passed; 0 failed; 0 ignored; 44 measured; 0 filtered out; finished in 180.75s

jqnatividad avatar Dec 24 '21 02:12 jqnatividad