Skip to content

Conversation

@JeremyRubin
Copy link
Contributor

There's a non-trivial performance regression in the Connect postprocess time. Part of the problem is that the vector is not preallocated & the elements are copy-constructed. This commit should fix those two concerns, and address the performance regression significantly.

s/o to @morcos for noticing that this was a slowdown.

src/main.cpp Outdated
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In c++11 the ugly '> >' (with a space in between) is no longer needed. Might as well fix it when you're changing it.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I mean at this point thats just like...coding style, right?

@sipa
Copy link
Member

sipa commented Sep 7, 2016

Ok, maybe I incorrectly assume that I'm not alone with finding this ugly and distracting :)

@JeremyRubin
Copy link
Contributor Author

I think we should just wait for the eventual clang-formattening; unless you really need that byte back.

@sipa
Copy link
Member

sipa commented Sep 7, 2016 via email

@JeremyRubin
Copy link
Contributor Author

Benchmark

Forgot to include with initial PR, it's something like 12% faster in connect postprocess.

@JeremyRubin JeremyRubin force-pushed the fix-perf-regressed-txChanged branch 2 times, most recently from 7d4ab3b to ec81881 Compare September 8, 2016 00:12
@JeremyRubin
Copy link
Contributor Author

push -f'ed a version where txData type template extra whitespace is removed as per @sipa's request.

Travis might fail because I force pushed twice and there's a known race condition on that.

@dcousens
Copy link
Contributor

dcousens commented Sep 8, 2016

utACK ec81881

@instagibbs
Copy link
Member

utACK ec81881

@sipa
Copy link
Member

sipa commented Sep 9, 2016

utACK ec81881

@sipa sipa merged commit ec81881 into bitcoin:master Sep 9, 2016
sipa added a commit that referenced this pull request Sep 9, 2016
ec81881 Performance Regression Fix: Pre-Allocate txChanged vector (Jeremy Rubin)
codablock pushed a commit to codablock/dash that referenced this pull request Jan 9, 2018
…d vector

ec81881 Performance Regression Fix: Pre-Allocate txChanged vector (Jeremy Rubin)
codablock pushed a commit to codablock/dash that referenced this pull request Jan 9, 2018
…d vector

ec81881 Performance Regression Fix: Pre-Allocate txChanged vector (Jeremy Rubin)
andvgal pushed a commit to energicryptocurrency/gen2-energi that referenced this pull request Jan 6, 2019
…d vector

ec81881 Performance Regression Fix: Pre-Allocate txChanged vector (Jeremy Rubin)
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Sep 8, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants