./source3/smbd/dir.c static struct dptr_struct *dptr_get(struct smbd_server_connection *sconn, int key, bool forclose) ... for (dptr = sconn->searches.dirptrs; dptr != NULL; dptr = dptr->next) { if(dptr->dnum != key) { continue; } .. Above for() is linear search. And I see dptr_struct is doubly LL. struct dptr_struct { struct dptr_struct *next, *prev; Can we add dnum in increasing or decreasing order, making it contender for binary search? O(logn) is far less than O(n) for 1000+ elements even!!
Amit, thanks for looking into improving Samba. To me this doesn't look to be a bug, but instead a possible performance improvement which you may want to discuss on the samba-technical mailing list. I don't think Samba bugzilla is the right place to discuss this. If you agree, please close the bugs and start a discussion on the mailing list. Thanks!