Remove redundant assignments (dead stores).
Remove redundant assignments (dead stores) #13767
pull practicalswift wants to merge 2 commits into bitcoin:master from practicalswift:remove-redundant-assignments changing 5 files +10 −16-
practicalswift commented at 2:34 PM on July 26, 2018: contributor
- fanquake added the label Refactoring on Jul 26, 2018
-
Empact commented at 9:18 PM on July 26, 2018: member
utACK 3e0fd18
-
promag commented at 1:44 PM on July 27, 2018: member
utACK 3e0fd18.
-
paveljanik commented at 7:04 PM on July 27, 2018: contributor
utACK 3e0fd18
-
in src/bench/crypto_hash.cpp:92 in 3e0fd18620 outdated
91 | { 92 | FastRandomContext rng(true); 93 | - uint32_t x = 0; 94 | while (state.KeepRunning()) { 95 | - x += rng.randbool(); 96 | + rng.randbool();
MarcoFalke commented at 7:14 PM on July 27, 2018:Have you checked if this changes the benchmark result. If yes, how much?
practicalswift commented at 1:24 PM on August 2, 2018:$ ./bench_bitcoin-before -filter=FastRandom_1bit WARNING: This is a debug build - may result in slower benchmarks. # Benchmark, evals, iterations, total, min, max, median FastRandom_1bit, 5, 440000000, 19.4505, 8.68817e-09, 9.03337e-09, 8.84262e-09 $ ./bench_bitcoin-after -filter=FastRandom_1bit WARNING: This is a debug build - may result in slower benchmarks. # Benchmark, evals, iterations, total, min, max, median FastRandom_1bit, 5, 440000000, 19.2027, 8.66309e-09, 8.81773e-09, 8.71708e-09@MarcoFalke, looks OK? :-)
in src/bench/rollingbloom.cpp:27 in 3e0fd18620 outdated
23 | @@ -25,7 +24,7 @@ static void RollingBloom(benchmark::State& state) 24 | data[1] = count >> 16; 25 | data[2] = count >> 8; 26 | data[3] = count; 27 | - match += filter.contains(data); 28 | + filter.contains(data);
MarcoFalke commented at 7:14 PM on July 27, 2018:Same here
practicalswift commented at 1:25 PM on August 2, 2018:$ ./bench_bitcoin-before -filter=RollingBloom WARNING: This is a debug build - may result in slower benchmarks. # Benchmark, evals, iterations, total, min, max, median RollingBloom, 5, 1500000, 13.066, 1.72693e-06, 1.76851e-06, 1.74017e-06 $ ./bench_bitcoin-after -filter=RollingBloom WARNING: This is a debug build - may result in slower benchmarks. # Benchmark, evals, iterations, total, min, max, median RollingBloom, 5, 1500000, 13.2987, 1.75024e-06, 1.82156e-06, 1.76487e-06@MarcoFalke, looks good as well? :-)
in src/txmempool.cpp:654 in 3e0fd18620 outdated
654 | const CTransaction& tx2 = it2->GetTx(); 655 | assert(tx2.vout.size() > txin.prevout.n && !tx2.vout[txin.prevout.n].IsNull()); 656 | fDependsWait = true; 657 | - if (setParentCheck.insert(it2).second) { 658 | - parentSizes += it2->GetTxSize(); 659 | - parentSigOpCost += it2->GetSigOpCost();
MarcoFalke commented at 7:16 PM on July 27, 2018:Instead of removing them, shouldn't they be asserted against
GetSizeWithAncestorset al?
practicalswift commented at 12:50 PM on August 2, 2018:@MarcoFalke I believe that is done later in the function – see ce019bf90fe89c1256a89c489795987ef0b8a18f. Am I reading it correctly? :-)
MarcoFalke commented at 1:17 PM on August 2, 2018:Right. Looks good.
MarcoFalke commented at 7:17 PM on July 27, 2018: memberThanks for taking a look here, but I am not yet convinced just removing them is the obviously correct thing to do.
Remove redundant assignments (dead stores) cdf4089457Remove unused variable dd777f3e12practicalswift force-pushed on Aug 2, 2018practicalswift commented at 12:32 PM on August 2, 2018: contributorMarcoFalke commented at 2:17 PM on August 2, 2018: memberutACK dd777f3e12
Empact commented at 6:59 PM on August 2, 2018: memberutACK dd777f3
practicalswift commented at 4:17 PM on August 27, 2018: contributor@promag @paveljanik Would you mind re-reviewing your previous utACK:s? :-)
MarcoFalke referenced this in commit fea4e9eca5 on Aug 27, 2018MarcoFalke merged this on Aug 27, 2018MarcoFalke closed this on Aug 27, 2018jasonbcox referenced this in commit fb43752bb6 on Oct 11, 2019jonspock referenced this in commit 60ec3efb02 on Dec 27, 2019jonspock referenced this in commit 66971e30c6 on Dec 29, 2019practicalswift deleted the branch on Apr 10, 2021Munkybooty referenced this in commit bb592c262a on Jun 30, 2021Munkybooty referenced this in commit 1d4f3edb8d on Jul 2, 2021pravblockc referenced this in commit c4ddf6486f on Jul 26, 2021pravblockc referenced this in commit 3bbd17c9e3 on Aug 3, 2021pravblockc referenced this in commit 49a7a8ad48 on Aug 3, 2021pravblockc referenced this in commit 6de74e958d on Aug 3, 2021pravblockc referenced this in commit f3dbd9e16e on Aug 3, 2021gades referenced this in commit 1fc808cb5b on May 24, 2022DrahtBot locked this on Aug 16, 2022ContributorsLabels
github-metadata-mirror
This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-16 15:15 UTC
This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-16 15:15 UTC
This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me
More mirrored repositories can be found on mirror.b10c.me