Optimizing Java using D

Russel Winder via Digitalmars-d digitalmars-d at puremagic.com
Fri Jun 20 23:44:58 PDT 2014


On Fri, 2014-06-20 at 23:59 +0000, bearophile via Digitalmars-d wrote:
> Walter Bright:
> 
> > If you could submit a bugzilla issue and include the faster 
> > version, that would be great!
> 
> My "faster" version is also doing lot of memory swaps (so it's 
> not faster in all cases), and it's not generic enough for the 
> current ranges, and it doesn't switch to a safe O(n ln n) sort 
> like a HeapSort when the ordering of the input data is bad, like 
> a safe introsort of a standard library has to do.
> 
> So while I sometimes use it, I don't think it will be an 
> improvement in the general case.

Both Python (since that is the original) and Java now use modified
Timsort as the standard sort. Java also has some specialization but not
to the extent of using Radix Sort, which would be a good idea for pure
integer data.

Per Nordlöw is offering a Radix Sort implementation. I had promised to
do a thorough review of his code, but have so far failed to do more than
a surface review. I clearly must try harder.

-- 
Russel.
=============================================================================
Dr Russel Winder      t: +44 20 7585 2200   voip: sip:russel.winder at ekiga.net
41 Buckmaster Road    m: +44 7770 465 077   xmpp: russel at winder.org.uk
London SW11 1EN, UK   w: www.russel.org.uk  skype: russel_winder



More information about the Digitalmars-d mailing list