-
Notifications
You must be signed in to change notification settings - Fork 95
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove boost::iterator_adaptor from VectorWithOffset #1442
Remove boost::iterator_adaptor from VectorWithOffset #1442
Conversation
- add more timings for basic building blocks (+=, *= etc) - allow skipping image/projdata timings
- remove boost::iterator_adaptor, detail::VectorWithOffset_iter is no longer needed, and begin() et al. now just return T*, allowing compilers to speed up std::copy etc - use std::make_reverse_iterator as opposed to the boost version
1bd8321
to
41763a9
Compare
Some timings on a beefy machine (30 threads) with a large TOF file (GE Signa PET/MR, view mashing 3, 3 segments, 33 TOF bins, total elems: 676,889,136). old timings (sorry, not all of them):
new timings:
Sadly, PMRT projection times are virtually identical (no CUDA on that machine). |
removed from VectorWithOffset so have to add it here
@markus-jehl one more for you to check... Obviously building on master, so presumably will have the same problem as #1438 |
MacOS job fails 1 ctest with just
|
MacOS job worked ok this time around, even though I didn't change the code (just the formatting of the test), so presumably this was just a borderline rounding case. |
@markus-jehl I have merged your fix on here. I'm more optimistic about this one making some positive impact, even if it's only be removing code complexity 😄 (and one more dependency on boost). |
Perfect, I'll give this a try! |
Codacy failure is because
|
again, no noticeable difference :-( |
ok. I guess this will only show up for LAFOV and/or TOF scanners. Anyway, the code is cleaner. Thanks for checking! |
boost::iterator_adaptor
code. Looks like we don't need it at all.VectorWithOffset<T>::iterator
is now aT*
. This allows compilers to speed-upstd::copy
et al. automatically (by usingmemmove
).stir_timings
to be able to check this.Before the change,
ProjDataInMemory::fill
was about 1.5 slower thanstd::copy
withstd::vector
, while now it is as fast. In addition,ProjDataFromStream::fill
now takes far less CPU time (although difference in wall-clock time on my test machine is very small, probably as that is dominated by IO). This is likely because theget_empty_segment_by_view()/segment.fill()/set_segment()
code is now faster.Fixes #1259