in reply to Re (tilly) 1: Data to hash via map problem
in thread Data to hash via map problem

Don't raise so much FUD about map, tilly! It's only slower in the current releases when the output array is larger than the input array.

One-to-one or one-to-less-than-one mapping is still quite fast: as fast as using a grep (on which the map code was originally based).

What was improved was the less common but equally useful case of one-to-more-than-one (more outputs than inputs), and that speedup code is in 5.7.0 and soon will be in 5.6.1 (about a month, I'm hearing from P5P).

-- Randal L. Schwartz, Perl hacker

  • Comment on RE: Re (tilly) 1: Data to hash via map problem

Replies are listed 'Best First'.
RE: RE: Re (tilly) 1: Data to hash via map problem
by tye (Sage) on Sep 06, 2000 at 19:23 UTC

    And the map under discussion is a one-to-two map, so the big slow-down does apply here.

    There are also plenty of cases where map leads to slower code, not because of map being slow but because of memory requirements or the need to create lots of small data structures.

    map often leads to less error-prone code and that is a strong reason to use it.

            - tye (but my friends call me "Tye")
RE (tilly) 3: Data to hash via map problem
by tilly (Archbishop) on Sep 06, 2000 at 19:45 UTC
    You are kidding around, right?

    As tye mentioned, this is exactly the case that hit the slowdown, and who should know better than me...? :-)

    Sheesh, I guess I will have to do something else sometime so you can have more to kid me about!