A note on Optimized Search Algorithm, a different approach

Technical discussion about the NMDC and <a href="http://dcpp.net/ADC.html">ADC</A> protocol. The NMDC protocol is documented in the <a href="http://dcpp.net/wiki/">Wiki</a>, so feel free to refer to it.

Moderator: Moderators

Locked
ivulfusbar
Posts: 506
Joined: 2003-01-03 07:33

A note on Optimized Search Algorithm, a different approach

Post by ivulfusbar » 2003-02-05 09:05

Inspired by 'Yilards' thread i began to monitor the search-requests i get
in a small hub with 100-150 users online 24/7. All users are required to
use dc++ or oDC (and yes, we allow linux clients etc.. but not nmdc).

Here follows a snap-shot of the stats recived, concerning stats ( i include other data so thay you can compare).

$Hello 176
$MyINFO 717
$OpList 10
$Quit 170
$Search 8372
$Search Size 8054
$Search Type 2187
<mainchat> 1371

I get 8372 search, and 8054 of these search sends exact size, i.e approx 96%. 2187 of the search also sends which kind of file-type, audio, video, picture etc... This number will raise as from 0.23 dc++ sends file-type in autosearchs, and i think Opera has added this to oDC also in 5.0.

My point is this, why not have an algorithm that uses size when searching for matches in your share. Naive approach is to sort by filesize and use a binarie search to find the right size. And then only string-match the files with same size.

Possible drawback is memory.

People only sharing rar with exactly 15MB will recive no decrease in cpu.

this-is-only-some-small-thought-on-the-subject-and-i-will-continue-to-look-into-the-ivul-of-searchs-ly'ers ;))
Everyone is supposed to download from the hubs, - I don´t know why, but I never do anymore.

ender
Posts: 224
Joined: 2003-01-03 17:47

Post by ender » 2003-02-05 10:55

Just curious - what's the point in banning NMDC from the hub?

Sedulus
Forum Moderator
Posts: 687
Joined: 2003-01-04 09:32
Contact:

Post by Sedulus » 2003-02-05 11:03

1) nmdc is crap
2) sends crap to mainchat
3) doesn't allow users to dl filelist without a slot
4) logs in more than once, and doesn't close properly so it may try to log in without you knowing it

we banned it too
http://dc.selwerd.nl/hublist.xml.bz2
http://www.b.ali.btinternet.co.uk/DCPlusPlus/index.html (TheParanoidOne's DC++ Guide)
http://www.dslreports.com/faq/dc (BSOD2600's Direct Connect FAQ)

ivulfusbar
Posts: 506
Joined: 2003-01-03 07:33

Post by ivulfusbar » 2003-02-05 11:03

i better make a follow up on this one, the real content of a search is the following (copy/pasted from Sedulus protocol-page btw...)

<sizerestricted>?<isminimumsize>?<size>?<datatype>?<searchpattern>

<sizerestricted> is T if the search should be restricted to files of a minimum or maximum size, otherwise F.
<isminimumsize> is F if <sizerestricted> is F or if the size restriction places an upper limit on file size, otherwise T.
<size> is the minimum or maximum size of the file to report (according to <isminimumsize>) if <sizerestricted> is T, otherwise 0.
<datatype> restricts the search to files of a particular type. It is an integer selected from:
1 for any file type
2 for audio files ("mp3", "mp2", "wav", "au", "rm", "mid", "sm")
3 for compressed files ("zip", "arj", "rar", "lzh", "gz", "z", "arc", "pak")
4 for documents ("doc", "txt", "wri", "pdf", "ps", "tex")
5 for executables ("pm", "exe", "bat", "com")
6 for pictures ("gif", "jpg", "jpeg", "bmp", "pcx", "png", "wmf", "psd")
7 for video ("mpg", "mpeg", "avi", "asf", "mov")
8 for folders


My point is this, without changing the protocol, the following can be achieved, an exact-search;

if sizerestricted == F and sminimumsize == whatever_you_want and size != 0:
Then interpret the size given as an exact search.

I think its a great idea, i have always interpreted the protocol as this was how it actually was, but when discussing it with Opera i understood that that was probably only me who did.


maybee-hess-managed-to-insert-a-possibility-to-have-exakt-size-searches-without-knowing-it-ly'ers

ps: danke Opera for valuable comments when you started to muck around with your code....
Everyone is supposed to download from the hubs, - I don´t know why, but I never do anymore.

ivulfusbar
Posts: 506
Joined: 2003-01-03 07:33

Post by ivulfusbar » 2003-02-05 11:12

damn, i want to rewrite this thread from scratch.. *smiles*, it would ofcourse only work for dc++-alike clients, but those or the once sending most searchs anyway.. so.. hmm..

i-will-pledge-the-fact-that-i-have-been-awake-to-many-hours-to-think-straight-so-tear-this-thread-and-my-thought-into-little-peaces-and-then-we-will-see-if-anything-remains-ly'ers ,))
Everyone is supposed to download from the hubs, - I don´t know why, but I never do anymore.

arnetheduck
The Creator Himself
Posts: 296
Joined: 2003-01-02 17:15

Post by arnetheduck » 2003-02-06 06:02

Yes, I've been considering exact file size searches for a while as well (would be nice for the autosearch in particular...)...the problem is of course that all nmdc clients out there won't play along, resulting in less search results...btw, the search size sent now is always one off the real size (i believe nmdc uses < & >, not <= & >=, but i'm not sure...)...

Locked