Trolltech Home | Qt-interest Home | Recent Threads | All Threads | Author | Date
All threads index page 1

Qt-interest Archive, February 2008
qSort could be better


Message 1 in thread

I apologise if I am sending this to the wrong list.

I have recently begun converting some existing C++ code to Qt and  
noticed some performance drop in some sort-intensive code. I had a  
look, and it turns out that qSort's can be improved quite a bit. I'm  
also not convinced it gets O(n log n) performance in all cases,  
although designing a case where it didn't would be hard.

I attach a patch to qtalgorithms.h to this mail, showing a suggested  
improvement. Warning: This is a proof-of-principle, I would do quite a  
bit more testing than I have done with this patch.

I had a look on the trolltech website, but it doesn't appear that  
patches to code are accepted from outside people. Is this true? I  
wouldn't want to bother doing any more work if the code wouldn't get  
used.

Thanks, Chris




  

Attachment: qSortPatch
Description: Binary data





Message 2 in thread

On Monday 04 February 2008 17:11:34 Chris Jefferson wrote:
> I apologise if I am sending this to the wrong list.

qt-bugs@tt might have worked as well.

>[,,]
> I had a look on the trolltech website, but it doesn't appear that  
> patches to code are accepted from outside people. Is this true?

That's not true ;-) Code from the outside can be accepted in general.

However, there's a process to go through including acquiring
copyright from the contributor (i.e. you) before the patch can
be incorporated.

> I  wouldn't want to bother doing any more work if the code wouldn't get  
> used.

Understandable ;-)

Regards,
Andre'

--
 [ signature omitted ] 

Message 3 in thread

André Pönitz wrote:
>However, there's a process to go through including acquiring
>copyright from the contributor (i.e. you) before the patch can
>be incorporated.

Let me explain this a bit better: Qt is a product that is licensed under 
three different licenses now: GPLv2, GPLv3 and the commercial license. 
That means that we can only add code to it that fits all those licenses 
at the same time. The easiest way to do that is, quite simply, for 
Trolltech to own the copyright. That way, Trolltech is allowed to 
relicense it whenever needed. That's what André is talking about.

However, that applies only to large code contributions. Small 
contributions and evident patches are accepted as such, because they are 
either not copyrightable in the first place. For example, there are only 
so many ways you can declare the errno constants in a C header (cf the 
IBM vs SCO case).

That doesn't mean we don't accept patches. More often than not, our 
engineers look at patches supplied by clients as a proof-of-concept and 
then work out the best solution. It may very well be the exact same 
change that the patch had, but it's up to our team to decide that. 

For instance, changes should not introduce regressions, so our internal 
relevant tests have to be run to make sure of that. And there are issues 
of naming convention, coding style, etc.

One other thing: if you just describe how to improve it (without providing 
code), there's no copyright problem. And I believe this is the case here 
(we talked on IRC a few days ago).

-- 
 [ signature omitted ] 

Attachment: signature.asc
Description: This is a digitally signed message part.


Message 4 in thread

Chris Jefferson wrote:
> I apologise if I am sending this to the wrong list.
> 
> I have recently begun converting some existing C++ code to Qt and  
> noticed some performance drop in some sort-intensive code. I had a  
> look, and it turns out that qSort's can be improved quite a bit. I'm  
> also not convinced it gets O(n log n) performance in all cases,  
> although designing a case where it didn't would be hard.
> 
> I attach a patch to qtalgorithms.h to this mail, showing a suggested  
> improvement. Warning: This is a proof-of-principle, I would 
> do quite a  
> bit more testing than I have done with this patch.
> 
> I had a look on the trolltech website, but it doesn't appear that  
> patches to code are accepted from outside people. Is this true? I  
> wouldn't want to bother doing any more work if the code wouldn't get  
> used.
> 
> Thanks, Chris

Hi Chris,
which Qt-Version are you using?

you can send this to qt-bugs@xxxxxxxxxxxxx and while they can't (i think
because of licensing reasons) just apply your patch, 
it'll certainly help to get your bugs fixed more quickly (if only to
prove that the current solution is suboptimal).

Cheers,
Peter

--
 [ signature omitted ]