473,549 Members | 2,408 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

What is best searching algorithm for URL

Our team is developing proxy server(in VC++)which can handle 5000
clients. I have to implement cache part so when ever a new request com
from client I have to check the request URL content is in cache of
proxy and send to client if it is cache, if it is not there then it
have to get data from web server and store in proxy server cache.

so i am thinking to use binary tree search(or AVL tree) to search
request URL content in cache if it is not there to insert in it
is it a good idea so that insertion and searching is faster
I also used hash table and key I has chosen according to first
character in URL
So now in that bucket it contain double linked list now I have search
in it, for that I am thinking to use binary tree

Jun 1 '06 #1
8 2376

sandeep wrote:
Our team is developing proxy server(in VC++)which can handle 5000
clients. I have to implement cache part so when ever a new request com
from client I have to check the request URL content is in cache of
proxy and send to client if it is cache, if it is not there then it
have to get data from web server and store in proxy server cache.

so i am thinking to use binary tree search(or AVL tree) to search
request URL content in cache if it is not there to insert in it
is it a good idea so that insertion and searching is faster
I also used hash table and key I has chosen according to first
character in URL
So now in that bucket it contain double linked list now I have search
in it, for that I am thinking to use binary tree


Your question is best answered in comp.programmin g, feel free to come
back here if you encounter C specific problems while implementing your
solution. Note: you say you're using VC++ -- if you're writing C++,
comp.lang.c++ is the place to go (but still ask algorithm questions in
comp.programmin g).

Jun 1 '06 #2

"sandeep" <sa*******@inco re.in> wrote in message
news:11******** **************@ c74g2000cwc.goo glegroups.com.. .
Our team is developing proxy server(in VC++)which can handle 5000
clients. I have to implement cache part so when ever a new request com
from client I have to check the request URL content is in cache of
proxy and send to client if it is cache, if it is not there then it
have to get data from web server and store in proxy server cache.

so i am thinking to use binary tree search(or AVL tree) to search
request URL content in cache if it is not there to insert in it
is it a good idea so that insertion and searching is faster
I also used hash table and key I has chosen according to first
character in URL
So now in that bucket it contain double linked list now I have search
in it, for that I am thinking to use binary tree

C has no build in hash tables nor binary trees, so you will have to
implement them yourself This is fiddly, though Chuck Falconer has a hash
library on his website which he is happy for people to use.
Anything else is comp.programmin g, as it is the algorithm which is your
problem. However either will probably provide perfectly acceptable
performance. .
--
Buy my book 12 Common Atheist Arguments (refuted)
$1.25 download or $7.20 paper, available www.lulu.com/bgy1mm
Jun 1 '06 #3
In article <11************ **********@c74g 2000cwc.googleg roups.com>,
sandeep <sa*******@inco re.in> wrote:
Our team is developing proxy server(in VC++)which can handle 5000
clients. I have to implement cache part binary tree search(or AVL tree) to search hash table and key I has chosen according to first
character in URL


Implement something clean and maintainable first, and *then*
measure to see if the performance is acceptable.

If you need unusually high performance searching, you need a lot
more information about your architecture -- points such as the
amount of primary cache you have; the size of the cache line
fetched from secondary cache; the interprocess communications
mechanisms to notify that something has entered or gone out of cache;
effective shared-memory mechanisms; locks and semaphores to
ensure cache coherency; details about the filesystem, about block
allocation strategies within the filesystem, details about the
seek times (i.e., you always want to go to a -nearby- disk block, but
"nearby" will depend upon in-track seek times, track-to-track seek
times, head-switch times, intelligence of the controller, level
at which the RAID is happening...)

And you shouldn't be getting too far into any of these until you
first read Knuth's "The Art of Computer Programming" volume on
"Searching and Sorting".
--
Okay, buzzwords only. Two syllables, tops. -- Laurie Anderson
Jun 1 '06 #4
Malcolm wrote:
"sandeep" <sa*******@inco re.in> wrote in message

.... snip ...

so i am thinking to use binary tree search(or AVL tree) to search
request URL content in cache if it is not there to insert in it
is it a good idea so that insertion and searching is faster
I also used hash table and key I has chosen according to first
character in URL
So now in that bucket it contain double linked list now I have
search in it, for that I am thinking to use binary tree


C has no build in hash tables nor binary trees, so you will have
to implement them yourself This is fiddly, though Chuck Falconer
has a hash library on his website which he is happy for people to
use. Anything else is comp.programmin g, as it is the algorithm
which is your problem. However either will probably provide
perfectly acceptable performance. .


At <http://cbfalconer.home .att.net/download/>. The nmalloc package
is licensed under GPL (not GLPL), but other licenses can be
negotiated.

--
Some informative links:
news:news.annou nce.newusers
http://www.geocities.com/nnqweb/
http://www.catb.org/~esr/faqs/smart-questions.html
http://www.caliburn.nl/topposting.html
http://www.netmeister.org/news/learn2quote.html
Jun 1 '06 #5
CBFalconer wrote:
Malcolm wrote:
"sandeep" <sa*******@inco re.in> wrote in message

... snip ...

so i am thinking to use binary tree search(or AVL tree) to search
request URL content in cache if it is not there to insert in it
is it a good idea so that insertion and searching is faster
I also used hash table and key I has chosen according to first
character in URL
So now in that bucket it contain double linked list now I have
search in it, for that I am thinking to use binary tree


C has no build in hash tables nor binary trees, so you will have
to implement them yourself This is fiddly, though Chuck Falconer
has a hash library on his website which he is happy for people to
use. Anything else is comp.programmin g, as it is the algorithm
which is your problem. However either will probably provide
perfectly acceptable performance. .


At <http://cbfalconer.home .att.net/download/>. The nmalloc package
is licensed under GPL (not GLPL), but other licenses can be
negotiated.


Correction - the hashlib package is ... nmalloc is unrestricted.

--
Some informative links:
news:news.annou nce.newusers
http://www.geocities.com/nnqweb/
http://www.catb.org/~esr/faqs/smart-questions.html
http://www.caliburn.nl/topposting.html
http://www.netmeister.org/news/learn2quote.html

Jun 1 '06 #6
sandeep wrote:
I also used hash table and key I has chosen according to first
character in URL


the first character of a url is likely to be a spectacularly bad choice
of key.

Jun 2 '06 #7
"CBFalconer " <cb********@yah oo.com> wrote
At <http://cbfalconer.home .att.net/download/>. The nmalloc package
is licensed under GPL (not GLPL), but other licenses can be
negotiated.


Correction - the hashlib package is ... nmalloc is unrestricted.

Why did you not LGPL it?
Not all commerical programmers work for evil huge corporations, you know.
Some are kids in bedrooms trying to make a useful living.
--
Buy my book 12 Common Atheist Arguments (refuted)
$1.25 download or $7.20 paper, available www.lulu.com/bgy1mm

Jun 3 '06 #8
Malcolm wrote:
"CBFalconer " <cb********@yah oo.com> wrote
At <http://cbfalconer.home .att.net/download/>. The nmalloc package
is licensed under GPL (not GLPL), but other licenses can be
negotiated.


Correction - the hashlib package is ... nmalloc is unrestricted.


Why did you not LGPL it?
Not all commerical programmers work for evil huge corporations, you know.
Some are kids in bedrooms trying to make a useful living.


Because it is a one way street. This way I at least expect
prospective licencees to contact me.

--
Some informative links:
news:news.annou nce.newusers
http://www.geocities.com/nnqweb/
http://www.catb.org/~esr/faqs/smart-questions.html
http://www.caliburn.nl/topposting.html
http://www.netmeister.org/news/learn2quote.html
Jun 3 '06 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
4397
by: Richard Berg | last post by:
Hello, I need to search a byte array for a sequence of bytes. The sequence may include wildcards. For example if the array contains 0xAA, 0xBB, 0xAA, OxDD then I want to be able to search for 0xAA, 0x?? and get two matches... I've been all around Google but still can't find any suggestions on how anything like this can be implemented........
2
6450
by: yee young han | last post by:
I need a fast data structure and algorithm like below condition. (1) this data structure contain only 10,000 data entry. (2) data structure's one entry is like below typedef struct _DataEntry_ { char szInput; char szOutput; int iSum;
12
1869
by: nib | last post by:
What kind of problems is c best at solving?
1
1244
by: Pacher R. Dragos | last post by:
I have recently developed an application in c witch acts like a system logger for windows 2003 server domain controllers and my problem is that of the size. In a normal day my program produces more than 3-4 Mb of data in plain text, and you can imagine that interpreting or getting information from such a big file is time consuming, that's why...
46
4166
by: Keith K | last post by:
Having developed with VB since 1992, I am now VERY interested in C#. I've written several applications with C# and I do enjoy the language. What C# Needs: There are a few things that I do believe MSFT should do to improve C#, however. I know that in the "Whidbey" release of VS.NET currently
1
1641
by: New Devil | last post by:
How can i implement searching in knowledge base.What is the simplest algorithm for searching in knowledge base.and how can i implement it in C#? Posted Via Usenet.com Premium Usenet Newsgroup Services ---------------------------------------------------------- ** SPEED ** RETENTION ** COMPLETION ** ANONYMITY **...
8
2349
by: Gordon Knote | last post by:
Hi can anyone tell me what's the best way to search in binary content? Best if someone could post or link me to some source code (in C/C++). The search should be as fast as possible and it would be great if the engine (or so) would accept multiple parameters (like a search offset, a max number of bytes to search in etc.) Any ideas Thanks...
5
2878
by: Tor Erik | last post by:
I would be surprised if it is the naive: m = 0 s1 = "me" s2 = "locate me" s1len = len(s1) s2len = len(s2) found = False while m + s1len <= s2len:
6
4075
by: pj | last post by:
Hi, I 'm currently writing a program that performs transliteration (i.e., converts greek text written using the english alphabet to "pure" greek text using the greek alphabet) as part of my thesis. I have decided to add the capability to convert words using some sort of lookup algorithm as a sidekick to the "normal" conversion algorithm,...
0
7736
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7982
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7500
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7827
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6066
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5385
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5110
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3494
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
783
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.