D12659: two new UDS structures

2018-05-04 Thread Jaime Torres Amate
This revision was automatically updated to reflect the committed changes. Closed by commit R241:01b2e536aeb3: two new UDS structures (authored by jtamate). REPOSITORY R241 KIO CHANGES SINCE LAST UPDATE https://phabricator.kde.org/D12659?vs=33607&id=33608 REVISION DETAIL https://phabricato

D12659: two new UDS structures

2018-05-04 Thread David Faure
dfaure accepted this revision. dfaure added a comment. This revision is now accepted and ready to land. Thanks REPOSITORY R241 KIO REVISION DETAIL https://phabricator.kde.org/D12659 To: jtamate, dfaure, #frameworks Cc: bruns, michaelh

D12659: two new UDS structures

2018-05-04 Thread Jaime Torres Amate
jtamate updated this revision to Diff 33607. jtamate added a comment. Removed some methods that are not used in the benchmarks. Added the asserts to check the type of the data at the beginning of every insert and replaceOrInsert. FYI: Checking the new implementation in live, so far only

D12659: two new UDS structures

2018-05-03 Thread Jaime Torres Amate
jtamate updated this revision to Diff 33543. jtamate marked 13 inline comments as done. jtamate edited the summary of this revision. jtamate edited the test plan for this revision. jtamate added a comment. I've included some methods that will be needed if AnotherUDSEntry replaces the current o

D12659: two new UDS structures

2018-05-03 Thread David Faure
dfaure added a comment. I like the replaceOrInsert idea, and the assert in insert... we might have to fix some kioslaves, but in general they have no good reason to insert twice for the same key. In general I like the std::vector + find_if + emplace_back solution. Fast and readable. IN

D12659: two new UDS structures

2018-05-02 Thread Stefan Brüns
bruns added inline comments. INLINE COMMENTS > udsentry_benchmark.cpp:483 > +inline Field(const uint index, long long value = 0) : m_long(value), > m_index(index) {} > +// This operator is essential to gain some speed, because the > default == is slow > +inline bool oper

D12659: two new UDS structures

2018-05-02 Thread Jaime Torres Amate
jtamate updated this revision to Diff 33507. jtamate added a comment. Another way to improve insertion speed in release could be: Transform "insert" to really insert only, with ASSERTS if it used as "replaceOrInsert" and add new methods "replaceOrInsert". The measurements in the first s

D12659: two new UDS structures

2018-05-02 Thread Jaime Torres Amate
jtamate updated this revision to Diff 33505. jtamate marked 3 inline comments as done. jtamate edited the summary of this revision. jtamate edited the test plan for this revision. jtamate added a comment. Fixed the ordered insertion. Using std::vector and std::find_if. Initialize everything

D12659: two new UDS structures

2018-05-02 Thread Stefan Brüns
bruns added inline comments. INLINE COMMENTS > udsentry_benchmark.cpp:467 > +inline Field(const uint index, long long value = 0) : m_long(value), > m_index(index) { } > +// This operator is essential to gain some speed, because the > default == is slow > +inline bool ope

D12659: two new UDS structures

2018-05-02 Thread Stefan Brüns
bruns added a comment. In D12659#257294 , @dfaure wrote: > In D12659#257292 , @bruns wrote: > > > In D12659#257098 , @dfaure wrote: > > > > > Thanks for

D12659: two new UDS structures

2018-05-02 Thread Jaime Torres Amate
jtamate marked 9 inline comments as done. jtamate added a comment. > If anyone attempts this, please name the struct and its members, don't use QPair ;-) > But no, that cannot possibly be faster. QVariant has lots of overhead itself. I've tried, just before reading your comment :-)

D12659: two new UDS structures

2018-05-02 Thread David Faure
dfaure added a comment. In D12659#257292 , @bruns wrote: > In D12659#257098 , @dfaure wrote: > > > Thanks for that investigation. Interesting that linear search is faster than binary search in the sa

D12659: two new UDS structures

2018-05-02 Thread Stefan Brüns
bruns added a comment. In D12659#257098 , @dfaure wrote: > Thanks for that investigation. Interesting that linear search is faster than binary search in the same data structure... maybe the compiler optimizes it better? Did you profile V2 to fin

D12659: two new UDS structures

2018-05-02 Thread David Faure
dfaure added a comment. Thanks for that investigation. Interesting that linear search is faster than binary search in the same data structure... maybe the compiler optimizes it better? Did you profile V2 to find out where the time is spent, or do you have a better explanation? But even if

D12659: two new UDS structures

2018-05-02 Thread Jaime Torres Amate
jtamate created this revision. jtamate added reviewers: dfaure, Frameworks. Restricted Application added a project: Frameworks. jtamate requested review of this revision. REVISION SUMMARY The two new UDS structures are similar to Frank's, but instead of using two vectors, use only one, with the