Comments (9)
It's the [old isValid] call on line 232 of RHAddressBookSharedServices.m. If you remove that, it seems to account for most of the slowness.
from rhaddressbook.
I don't think some of the geo logic gets quite as much testing as other areas in general.
I'll see what i can do, however i'm out in the field atm, so currently have limited connectivity.
from rhaddressbook.
Okay nice. No problem this ain't an issue so it is not that urgent. Also I sometime get a lot a slowness when accessing properties through this lib compared to using apple C API with the recordRef property from your classes. It can sometimes multiply by a factor 10 or even more the total time of execution.
from rhaddressbook.
If I don't need address geolocation in my app, would it cause a problem if I just disabled the entire if(addresses)
statement?
from rhaddressbook.
Even with geocoding disabled, RHAddressBook is still slower than direct access by a very long way. Looking at the profiler it seems that the thread safety is the root of the problem. Enumerating contacts using RHAddressBook adds a whole second or so delay. Unless I've missed something obvious, this is a major bummer.
from rhaddressbook.
Feel free to post the code you are using to do these comparisons. Depending on what exactly you are doing, there will likely be ways to optimise it, however i've never had a need to do so. I'm always open to pull requests.
from rhaddressbook.
I'm seeing same slowness but interestingly only when I set my iPhone5 device language to Finnish. When it's English, it works okay. When it's Finnish, my main thread blocks for minutes.
I added some debugging NSLog's, there you can see how slow it is:
2013-08-01 16:12:52.309 blindsquarebeta[283:907] -[RHAddressBookSharedServices loadCache]:192
2013-08-01 16:12:52.321 blindsquarebeta[283:c703] -[RHAddressBookSharedServices rebuildCache]:219
2013-08-01 16:12:56.930 blindsquarebeta[283:c703] ** isValid
2013-08-01 16:12:56.931 blindsquarebeta[283:c703] ** associatedAddressDictionary
2013-08-01 16:12:56.933 blindsquarebeta[283:c703] ** starting ABAddressBookCreateWithOptions
2013-08-01 16:13:29.891 blindsquarebeta[283:c703] ** ABAddressBookCreateWithOptions done
2013-08-01 16:13:37.191 blindsquarebeta[283:c703] ** associatedAddressDictionary done
2013-08-01 16:13:37.192 blindsquarebeta[283:c703] ** newHash call
2013-08-01 16:13:37.195 blindsquarebeta[283:c703] ** newHash = 6d4948fc85746e95752bc78986a52152
2013-08-01 16:13:38.578 blindsquarebeta[283:c703] ** isValid
2013-08-01 16:13:38.579 blindsquarebeta[283:c703] ** associatedAddressDictionary
2013-08-01 16:13:38.580 blindsquarebeta[283:c703] ** starting ABAddressBookCreateWithOptions
2013-08-01 16:14:11.224 blindsquarebeta[283:c703] ** ABAddressBookCreateWithOptions done
So, in RHAddressBookGeoResults.m, in -(NSDictionary*)associatedAddressDictionary,
just calling "addressBookRef = ABAddressBookCreateWithOptions(nil, &errorRef);"
takes 33 seconds!
I copy paste little more so you can see my NSLog's:
-(NSDictionary*)associatedAddressDictionary{
NSLog(@"** associatedAddressDictionary");
NSDictionary *result = nil;
ABAddressBookRef addressBookRef = NULL;
#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 60000
if (ABAddressBookCreateWithOptions != NULL){
CFErrorRef errorRef = NULL;
NSLog(@"** starting ABAddressBookCreateWithOptions");
addressBookRef = ABAddressBookCreateWithOptions(nil, &errorRef);
NSLog(@"** ABAddressBookCreateWithOptions done");
PS. I'm testing with latest iOS6 in device
from rhaddressbook.
Hmmm. Very strange re the language thing. I spent some time trying to reproduce on my iOS 6 device, however it behaved correctly.
Any chance you could chuck the code in question up in a gist?
from rhaddressbook.
Thank you for looking this. I just got it working -- I was initializing RHAddressBook from viewDidAppear. I added 0.1 second delay to initialization and it solved the problem. So, some timing related problem which was triggered by language setting...
from rhaddressbook.
Related Issues (20)
- Crash in NSThread+RHBlockAdditions.h HOT 1
- Failed to create RHAddressBookSharedServices instance
- 3-5 Seconds to initialize HOT 1
- implicit conversion
- Localized address format? HOT 1
- New RHPerson in Local addressbook when default is Icloud ?
- Not receiving Notifications in swift
- Native Swift version
- Compile issues with latest source HOT 2
- Update version in Cocoapods repository to 1.2.0 HOT 1
- Why RHAddressBook/AddressBook.h file not find?
- [RHPerson vCardRepresentationForPeople:] crash
- Crash in RHAddressBook vCardRepresentationForPeople
- Xcode 6.3 reports semantic issues HOT 1
- application blocks when i click one group in tableview
- Does RHPerson support NSCoing? How can I NSCoding RHPerson?
- RHRecord crash HOT 3
- import for Swift? HOT 1
- Update the example & README for non-ARC version?
- How can I get google id (social type id)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rhaddressbook.