XML Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreXML Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old September 22nd, 2003, 02:41 PM
dmanzoni dmanzoni is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Posts: 13 dmanzoni User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
efficiency client side xml

hi , I've a database on my web site xml of 3 mb and i wrote a search function whith javascript client side ( i can not install any program on the server)

Whith a fast client pc and fast connection I don't have any problem but with a old pc with 64 Ram and 200 mhz is too slow and i can't even load the page .
You think i can improve the efficiency of javasrcipt or is better to study a new solution wit xls--xpath
ReLLY I DON'T KNOW IF A XLS STILESHETT IS MORE EFFICIENT THAN A JAVASCRIPT IN THIS CASE .SOMEBODY KNOWS?

(i only need to intersect 2 categoires in each page)

i.e.

article= dresses
Stilist =Armani

Reply With Quote
  #2  
Old September 22nd, 2003, 03:00 PM
jharnois's Avatar
jharnois jharnois is offline
mod_dev_shed
Dev Shed God 19th Plane (14000 - 14499 posts)
 
Join Date: Sep 2002
Location: Atlanta, GA
Posts: 14,468 jharnois User rank is Lieutenant General (80000 - 90000 Reputation Level)jharnois User rank is Lieutenant General (80000 - 90000 Reputation Level)jharnois User rank is Lieutenant General (80000 - 90000 Reputation Level)jharnois User rank is Lieutenant General (80000 - 90000 Reputation Level)jharnois User rank is Lieutenant General (80000 - 90000 Reputation Level)jharnois User rank is Lieutenant General (80000 - 90000 Reputation Level)jharnois User rank is Lieutenant General (80000 - 90000 Reputation Level)jharnois User rank is Lieutenant General (80000 - 90000 Reputation Level)jharnois User rank is Lieutenant General (80000 - 90000 Reputation Level)jharnois User rank is Lieutenant General (80000 - 90000 Reputation Level)jharnois User rank is Lieutenant General (80000 - 90000 Reputation Level)jharnois User rank is Lieutenant General (80000 - 90000 Reputation Level)jharnois User rank is Lieutenant General (80000 - 90000 Reputation Level)jharnois User rank is Lieutenant General (80000 - 90000 Reputation Level)jharnois User rank is Lieutenant General (80000 - 90000 Reputation Level) 
Time spent in forums: 1 Month 1 Week 2 Days 15 h 43 m 28 sec
Reputation Power: 825
I don't have any experience with an XML file of that size, but it seems like it'd be easy enough to write a quick XSL stylesheet and see how fast it works.
__________________
# Jeremy

Explain your problem instead of asking how to do what you decided was the solution.

Reply With Quote
  #3  
Old September 22nd, 2003, 05:34 PM
bricker42 bricker42 is offline
Moderator =(8^(|)
Dev Shed Intermediate (1500 - 1999 posts)
 
Join Date: Feb 2002
Location: Sacramento, CA
Posts: 1,710 bricker42 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 20 m 38 sec
Reputation Power: 8
Send a message via AIM to bricker42
I agree with Jeremy. Unless you're really in a hurry the best approach is going to be trying a quick test.

One thing you might think about is some sort of asynchronous processing. Load the xml file in a hidden iframe then pull the results into the main page when they're done. It takes the same amount of time but it can look faster to the user.
__________________
-james

Reply With Quote
  #4  
Old September 26th, 2003, 05:41 AM
dmanzoni dmanzoni is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Posts: 13 dmanzoni User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
what about dom sas

I 've read that dom technology is not efficient because it load all the document in cache : what does it mean ?
If i use 3 MB xml document would it be a problem using a javacript based on dom technology?
What is it a good alternative?
I nead to select different categories in different page html of a 3 mega database in a client side application in the most efficient way
Somebody can help me ?

Reply With Quote
  #5  
Old September 26th, 2003, 11:31 AM
bricker42 bricker42 is offline
Moderator =(8^(|)
Dev Shed Intermediate (1500 - 1999 posts)
 
Join Date: Feb 2002
Location: Sacramento, CA
Posts: 1,710 bricker42 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 20 m 38 sec
Reputation Power: 8
Send a message via AIM to bricker42
I don't think you're going to take a performance hit with javascript just because it's DOM. I'm not positive, but I think the browser already has the DOM of the current document stored in memory whether you're accessing it or not. DOM *is* slower when you're talking about processing an xml stream, though. Of course, DOM is really the only viable way to manipulate an xml document.

As for efficiently manipulating 3MB of data on the client-side: is your data stored in a single file? Because if you can get your users to sit long enough to download a 3MB document, I don't think it's going to matter how much manipulation you do. If it's in seperate files then javascript probably makes the most sense. If you feel like experimenting XSLT can be used to transform multiple files into one for viewing.

Reply With Quote
  #6  
Old September 27th, 2003, 04:48 AM
dmanzoni dmanzoni is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Posts: 13 dmanzoni User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
yes only 1 file

hi
yes the data are only 1 file that i receiv eevery day and is not possible to change that :
so my question is : if i 've the 3 Mb xml on my server is necessary to download the whole file on the client?

isn'it possible to load only 1 part with xls on html page ?

I performed a javascipt search engine that it takes few second on my pc 2,4 ghz 512 ram .(fast connection) to searc whithin 40.000 products you can try it on

www.corso22marzo.com/saldi.htm

Bur it's very slow on slower system!!!


Than i'm tring a faster solution with xls witout any search (it's not necessary to have a seach engine: My main desire is to have some html pages loading parts of xml)
:
i only wanto to load directly some selection of xlm in different pages html as i did in www.corso22marzo.com/xPath.htm

but also with this simpler solution that looks faster I v' problem with compatibilty with IE5

I accept any suggestions

Reply With Quote
  #7  
Old September 27th, 2003, 12:22 PM
bricker42 bricker42 is offline
Moderator =(8^(|)
Dev Shed Intermediate (1500 - 1999 posts)
 
Join Date: Feb 2002
Location: Sacramento, CA
Posts: 1,710 bricker42 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 20 m 38 sec
Reputation Power: 8
Send a message via AIM to bricker42
Like I said, I doubt you're going to get faster than the javascript approach. I'm not positive about the data binding method you're using, but I'm pretty sure that with xsl you're going to have to download the whole xml document.

Reply With Quote
  #8  
Old September 28th, 2003, 11:57 AM
dmanzoni dmanzoni is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Posts: 13 dmanzoni User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
I'm not vey expert but how do you explain that to load [http://www.corso22marzo.com/yoox/Em...taloni_Uomo.htm]http://www.corso22marzo.com/yoox/Emporio_Armani_Pantaloni_Uomo.htm[/URL]

is 10 times faster than loading

http://www.corso22marzo.com/saldi.htm ?

the first use xls and the second has a link with dom javascript


I really would like to understand because javascipt is really more easy to program than xls ( I don even know if it is possible to have search function in xls ) but javascript looks 10 timeslower try yourself

what do you mean with data binding?

I accept any help

Reply With Quote
  #9  
Old September 30th, 2003, 08:23 AM
dmanzoni dmanzoni is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Posts: 13 dmanzoni User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
hi

I realised that it really take long time for a 56 K modem to download 3 MB XML file : (even with xsl solution)

My question still is:

is it possible in some way to allow the client to download only 1 part of xml ?


And if not, How is possible to do an asyncrous download in the best way?


I mean : How can one web visitor brwse my web site while his browser is downloading the 3 Mb whitout being disturbed by the download ? if possible without even knowing that he is downloading it?

Reply With Quote
  #10  
Old September 30th, 2003, 11:37 AM
bricker42 bricker42 is offline
Moderator =(8^(|)
Dev Shed Intermediate (1500 - 1999 posts)
 
Join Date: Feb 2002
Location: Sacramento, CA
Posts: 1,710 bricker42 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 20 m 38 sec
Reputation Power: 8
Send a message via AIM to bricker42
I hate to tell you but it takes a long time download on a 608k dsl, too .

As for asynchronous downloads, you'll probably have to use frames. A frameset would be the easiest approach, since people could navigate you site in one frame while downloading in the other. You can also use iframes, but the download will start again each time the person moves to a new page.

Another option is to use a pop-up window. They're annoying, but you could use javascript to query the window from anywhere in your site.

Reply With Quote
  #11  
Old September 30th, 2003, 04:52 PM
dmanzoni dmanzoni is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Posts: 13 dmanzoni User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
thanks ..some more ideas to improve?

thanks for you help
i did a popup in

www.corso22marzo.com/Negozi/Abbigliamento.htm

but i'm not satisfied yet

I think the only viable way to keep client side solution (i STILL DON'T HAVE ANY MYSQL KNOLEDGE and technplogy) IS to split the xml file in smaller ones : isn't it ?


could i reduce it by changing the tag ? I mean if stilista becames "st", "prodotti" .."pr"..and son on ... it should reduce some byte (THEY appears thousands of times !)

But the problem in that case is that I dont' have any istrument to do the substitution every dAY very fast with a 3 Mb file: do you know some tool ? wordpad or word get stuck with 3 MB
is it possibel to do it with xsl?



probably I should write some code that does the reducing job offline in some language and than I upload smaller the files every day ..annoyng work but if neccessary


Does somoebody here knows some xml splitting tools?

what about the idea is to split the xml in categories smaller ...so visitors shuold choose before a category and than searc within it?

the problem is still to find a splitting tool and a scheduling tool for the upload ...I accept any suggestion

Thanks a lot

D

Reply With Quote
  #12  
Old October 1st, 2003, 02:02 PM
bricker42 bricker42 is offline
Moderator =(8^(|)
Dev Shed Intermediate (1500 - 1999 posts)
 
Join Date: Feb 2002
Location: Sacramento, CA
Posts: 1,710 bricker42 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 20 m 38 sec
Reputation Power: 8
Send a message via AIM to bricker42
Well, you can speed the download by using mod_gzip for apache. That's still going to be put a bit of a strain on the client since it has to load the whole document into memory.

It should be possible to write an xslt that splits the document into multiple categories. Also, if you can run ANY kind of programs on the server you should be able to do the searching on the server's end.

Last thing you can do for global search and replace is use some Unix tools (available for windows too) or other script processing method to transform the text. It should be something you can automate that runs on a daily basis.

Reply With Quote
  #13  
Old October 2nd, 2003, 11:28 AM
dmanzoni dmanzoni is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Posts: 13 dmanzoni User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
thank but NO PROGRAM on the server

Thank i'm rally learning a lo t
but acttualy I can not run nothing on the server only html (and javascript of course )

Do you think i can do the search on the remote server?I think it not possible do you? (i mean without any program running on it!)

the xlst that split the xlm does it " create" smaller xlm that I can upload on the remote server without the big one ?


the speed tool can it work even if I can not install anythig on th e server??

now i splitted in two my file (men and women) and I changed the tags: I ve two file e 340 K and 900 k still too big I think !!!

I'm thinhing to "transcode" with search and replace tool everything --(i.e. Armani --> becames "1") an tha trascode agin when dowloaded by js ("1"--> armani) to reduce the byte but probably is it a goog Idea in yopur opinion?

I shuold wirte som code in some laguage to do it on daily basis isn'it?



Thank a lot

Reply With Quote
  #14  
Old February 15th, 2004, 07:02 AM
Kim Turley Kim Turley is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2003
Posts: 21 Kim Turley User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
I'm also trying to do a similar thing with a movies database.

there are 27 different xml files, one for each letter of the alphabet plus one for numbers.

So far this is what I have got:

http://www.gre.ac.uk/~tk301/3dmm/

I have solved some loading problems, by reducing the code to the minimum possible, and also as they are split into letters, anyone brwosing the archive only has to load one xml per page, unless they do the search.

For the search it uses javascript and then the xsl stylesheet processes the formatting. Ideally I wanted the stylesheet to have the search too as apprently it has the facility to search non case-sensitive too. More info on my plight is here:

http://www.experts-exchange.com/Web...Q_20873726.html

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreXML Programming > efficiency client side xml


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump