|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
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 |
|
#2
|
||||
|
||||
|
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. |
|
#3
|
|||
|
|||
|
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 |
|
#4
|
|||
|
|||
|
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 ? |
|
#5
|
|||
|
|||
|
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. |
|
#6
|
|||
|
|||
|
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 |
|
#7
|
|||
|
|||
|
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.
|
|
#8
|
|||
|
|||
|
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 |
|
#9
|
|||
|
|||
|
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? |
|
#10
|
|||
|
|||
|
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. |
|
#11
|
|||
|
|||
|
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 |
|
#12
|
|||
|
|||
|
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. |
|
#13
|
|||
|
|||
|
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 |
|
#14
|
|||
|
|||
|
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 |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > XML Programming > efficiency client side xml |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|