Return-Path: X-Original-To: apmail-incubator-callback-dev-archive@minotaur.apache.org Delivered-To: apmail-incubator-callback-dev-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 01DD899F8 for ; Wed, 28 Mar 2012 20:47:54 +0000 (UTC) Received: (qmail 76204 invoked by uid 500); 28 Mar 2012 20:47:54 -0000 Delivered-To: apmail-incubator-callback-dev-archive@incubator.apache.org Received: (qmail 76177 invoked by uid 500); 28 Mar 2012 20:47:54 -0000 Mailing-List: contact callback-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: callback-dev@incubator.apache.org Delivered-To: mailing list callback-dev@incubator.apache.org Received: (qmail 76169 invoked by uid 99); 28 Mar 2012 20:47:54 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 28 Mar 2012 20:47:54 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED,T_RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.116] (HELO hel.zones.apache.org) (140.211.11.116) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 28 Mar 2012 20:47:52 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id 7175E34B862 for ; Wed, 28 Mar 2012 20:47:31 +0000 (UTC) Date: Wed, 28 Mar 2012 20:47:31 +0000 (UTC) From: "Shazron Abdullah (Commented) (JIRA)" To: callback-dev@incubator.apache.org Message-ID: <1990628619.29987.1332967651480.JavaMail.tomcat@hel.zones.apache.org> In-Reply-To: <1372425270.26354.1332893962258.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Commented] (CB-402) Improve Contacts search taking a long time by using (NSArray*)filteredArrayUsingPredicate:(NSPredicate*)predicate MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/CB-402?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13240718#comment-13240718 ] Shazron Abdullah commented on CB-402: ------------------------------------- We'll have to do some quick proof of concept tests to see if it covers the breadth of our requirements, but on a cursory search on the Internet, I found some examples: https://github.com/erica/ABContactHelper/blob/master/ABContactsHelper.m#L101 But I won't even proceed with this if our benchmarks don't show a significant (more than 10%? dunno) improvement for tests that demonstrate the problem. > Improve Contacts search taking a long time by using (NSArray*)filteredArrayUsingPredicate:(NSPredicate*)predicate > ----------------------------------------------------------------------------------------------------------------- > > Key: CB-402 > URL: https://issues.apache.org/jira/browse/CB-402 > Project: Apache Callback > Issue Type: Improvement > Components: iOS > Reporter: Shazron Abdullah > Assignee: Shazron Abdullah > > We have to analyze this first to see if it is a big problem, with a huge N. I believe it is. > Right now our search method is O( n ), while using Apple's search method it is possibly O( log n ) - but that's just a guess if I assume internally they use a binary search. > Steps: > 1. Grab all the contacts in a NSArray through ABAddressBookCopyArrayOfAllPeople > 2. Construct a NSPredicate for the filter, and call filteredArrayUsingPredicate on the NSArray returned in step 1. > 3. Convert the NSArray returned in step 2. to our CDVContact objects -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira