Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to speed search operation in .NET compact Framework

Status
Not open for further replies.

VenkatRastapuram

Programmer
Oct 24, 2003
46
IN
Hello Sir,

I have developed an application which reads contents from a file and searches for a particular pattern in the file. As my file is about 365KB, my application has become very slow and it is taking nearly 1-2 minutes for searching. This application should be run in pocketPC 2002 and 2003.

So, Please tell me if there is any solution which makes the search opertion quicker.

Will there be any improvement if I use SQL CE.

Please help me in this regard.

Regards,
R.Venkatesh
MakeLogic
venkat@makelogicmldb.com
 
How are you storing the data, and how are you doing the search presently?

Chip H.


If you want to get the best response to a question, please check out FAQ222-2244 first
 
In addition of Chip H questions I add:
1. Do you search the whole file to find out all records with the same pattern ?
2. Do you stop when the first record with the pattern is found ?
3. Do you perform this operation many times on the same file ?
-obislavu-
 
Hello Obislavu,

Thank you for responding to my question. The following are the answers to your questions.

1) I am using a XML file as a source file.

2) Yes I search the entire file.(answer to your first question)

3) No, I need to search the entire file.(answer to your second question)

4) Yah, I have to do this operation many times on the same file but my file will be updated for every one week.(answer to your third question)

Please try to help in solving my problem

Regards,
R.Venkatesh
MakeLogic
venkat@makelogicmldb.com
 
I was going to suggest using an XPath query (the standard way of finding data in XML files), but it turns out that that isn't supported in the compact framework:

ms-help://MS.VSCC.2003/MS.MSDNQTR.2003FEB.1033/dv_evtuv/html/etconxmlsupport.htm

You might want to change from XML to a flat-file format. XML is very wordy, and your in-memory size will be much smaller (thus searches will be faster). You might also consider reading in the entire file in a background thread and constructing an in-memory index.

Chip H.


If you want to get the best response to a question, please check out FAQ222-2244 first
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top