in reply to Re: Re: Re: *Fastest* way to print a hash sorted by value
in thread *Fastest* way to print a hash sorted by value

I can imagine that calling keys in scalar context for a tied hash is really slow — as slow as the loop for the actual job, later on. Therefore, perhaps I should keep a running counter, and postpone the test until after everything is done. The season for the test is really because I collect $keep items without sorting them. In this case, we need a final sort.

Perhaps we can do a final sort in any case, and skip keeping the counter.

  • Comment on Re: Re: Re: Re: *Fastest* way to print a hash sorted by value