>
> I don't understand why it's so slow. I'm actually doing benchmarking and 
> optimization on iOS right now, so I have numbers handy. CBL 1.0.3 on my 
> iPhone 6 indexes about 1500 documents per second. (These are docs taken 
> from my iTunes library metadata, they have about as many properties as 
> yours do.) The speed you're quoting is about *two orders of magnitude* 
> slower!
>
> The only difference is Objective-C vs JavaScript for the map function 
> itself, and JS will definitely be slower but it shouldn't be *that* much 
> slower. I also don't think other PhoneGap developers have run into this in 
> their apps.
>
> —Jens
>

By what you are saying i guess there is something i might be doing wrong. 
But currently the only clue i have is that i should not emit entire doc. 
Other then that i don't have much clue what to do to find the cause as a 
simple ajax call takes 5 secs to get a response the first time i query the 
view. I will use the include_docs parameter as u said and find out if there 
is something wrong in my map function. Just for you to see below is the 
design document which has the views for the sample doc i posted above. 

var design = "_design/account";
   db.put(design, {
     views: {
       ByType: {
         map: function(doc) {
           if (doc.type && doc.type == "account") {
             emit(doc.cat, doc);
           }
         }.toString()
       },
       BySubCat: {
         map: function(doc) {
           if (doc.type && doc.type == "account") {
             emit(doc.subCat, doc);
           }
         }.toString()
       }
     }
   }, function() {
     window.config.accountViews = db([design, "_view"]);
     //generateCatDesginDoc(db, cb);
     //cb(false, db([design, "_view"]));
   });

Other then emitting doc itself the map function is pretty simple.

-- 
You received this message because you are subscribed to the Google Groups 
"Couchbase Mobile" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/mobile-couchbase/c47505ff-39f5-4c2a-b278-7854f757af36%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to