[erlang-questions] Performance of matches

Darren New dnew@REDACTED
Thu May 29 18:34:54 CEST 2008


Speaking of table-driven decisions...

Is a function like this efficiently matched?

table1("hello") -> ...;
table1("byebye") -> ...;
table1("morning") -> ...;
   ... and so on for dozens more ...

How about
table2(hello) -> ...;
table2(byebye) -> ...;
table2(morning) -> ...;
    ... And so on for dozens more ...

Is either of those O(1) lookup time?

-- 
   Darren New / San Diego, CA, USA (PST)
     "That's pretty. Where's that?"
          "It's the Age of Channelwood."
     "We should go there on vacation some time."



More information about the erlang-questions mailing list