Mathematica 9 is now available
Student Support Forum
-----
Student Support Forum: 'MemberQ is really... really... slow.' topicStudent Support Forum > General > Archives > "MemberQ is really... really... slow."

Next Comment >Help | Reply To Topic
Author Comment/Response
Alvin
03/24/06 04:20am

$src,$srcx,$list are all integers.
Length[$src] =100000
Length[$srcx]=100000
Length[$list]=5000

Pick[$src,MemberQ[$srcx,#]&/@$list];
Well, this takes almost a minute on P4 2.66G

So, I Dispatched some help...

Pick[$src, $srcx/.Dispatch[Thread[$list->True]]];

the timing goes down to 0.19 secs..

No questions here, just want to share with you guys who always deals with large lists.

Anyway, any idea how to make this even faster??
I definitely need it...

URL: ,

Subject (listing for 'MemberQ is really... really... slow.')
Author Date Posted
MemberQ is really... really... slow. Alvin 03/24/06 04:20am
Re: MemberQ is really... really... slow. yehuda ben-s... 03/24/06 09:58am
Re: MemberQ is really... really... slow. Alvin 03/25/06 8:34pm
Next Comment >Help | Reply To Topic