in reply to Bucket sort - reducing memory requirements and preserving speed

I was wondering does anyone know a trick to reduce memory requirement during a bucket sort without significantly reducing the speed

How? (which module or post code); and why? -- reasoning -- are you using a "bucket sort" from Perl?

Given that:


With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice. Agile (and TDD) debunked
  • Comment on Re: Bucket sort - reducing memory requirements and preserving speed
  • Download Code

Replies are listed 'Best First'.
Re^2: Bucket sort - reducing memory requirements and preserving speed
by karlgoethebier (Abbot) on Jan 13, 2015 at 19:00 UTC

    Running your code on my box:

    karls-mac-mini:monks karl$ ./kgb-1113079.pl sorting 300 integers took: 0.000077 sorting 3000 integers took: 0.000099 sorting 30000 integers took: 0.000770 sorting 300000 integers took: 0.008718 sorting 3000000 integers took: 0.084943

    Seems like you got some slow machine bro ;-)

    Best regards, Karl

    «The Crux of the Biscuit is the Apostrophe»

      Seems like you got some slow machine bro ;-)

      Indeed. It's a 7 year old Core™2 Quad Processor Q6600 running at 2.4GHz; but its more than adequate for development.


      With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
      Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
      "Science is about questioning the status quo. Questioning authority".
      In the absence of evidence, opinion is indistinguishable from prejudice. Agile (and TDD) debunked
        ...a 7 year old Core™2 Quad Processor Q6600...

        Old gear is good gear. Nice that it's still working.

        Best regards, Karl

        «The Crux of the Biscuit is the Apostrophe»