473,573 Members | 2,545 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

fastest way to load and process 100 rows variable

I got a javasscript based aplication, which is working with data from
server (php&sql, changed once per week or so). Actualy I use a xml as a
data format with structure e.g.
[item var1="smthng" var2="123" var3="456" var4="ABC" /]
I open read the file through XMLHttpRequest and then i do smtg like

items = documentElement .getElementsByT agName("item");
for i=0 to items.lenght {
var1=item[i].getAttribute(" var1")
....
function(var1, var2, var3, var4)
}

The problem is, that it is quite slow with 100 items i'am sometimes
over 5 secs total execution time on firefox and it than write an error
message. The others browsers do not write this message, but they are
even slower, up to 20 secs for IE
The slow thing is that file access and making a variable from it.

If wonder that there may be some much faster way, as i do not need the
data to be in xml, i can make any data format, i can even make
something like var dump. But i do not know how to parse this dump to
variable, and i do not know if it will be faster

Or are there some other fast ways how to quicker load the data?

Aug 7 '06 #1
1 1474

TKapler wrote:
I got a javasscript based aplication, which is working with data from
server (php&sql, changed once per week or so). Actualy I use a xml as a
data format with structure e.g.
[item var1="smthng" var2="123" var3="456" var4="ABC" /]
I open read the file through XMLHttpRequest and then i do smtg like

items = documentElement .getElementsByT agName("item");
for i=0 to items.lenght {
var1=item[i].getAttribute(" var1")
...
function(var1, var2, var3, var4)
}

The problem is, that it is quite slow with 100 items i'am sometimes
over 5 secs total execution time on firefox and it than write an error
message. The others browsers do not write this message, but they are
even slower, up to 20 secs for IE
The slow thing is that file access and making a variable from it.

If wonder that there may be some much faster way, as i do not need the
data to be in xml, i can make any data format, i can even make
something like var dump. But i do not know how to parse this dump to
variable, and i do not know if it will be faster

Or are there some other fast ways how to quicker load the data?
Try JSON:

<URL: http://www.json.org/ >

e.g.

// jsonTxt is returned by the XMLHttpRequest
// Preferrably machine generated, getting the syntax right
// can be tricky if done manually
var jsonTxt =
'{'
+ 'item0 : ["smthng", "123", "456", "ABC"],'
+ 'item1 : ["nudder", "asd", "dfgh", "D"],'
+ 'item2 : ["anudder", "lkj", "oiu", "E"]'
+ '}';

var items = eval( '(' + jsonTxt + ')' );

function showArgs(){
var args = [];
for (var i=0; i<arguments.len gth; i++){
args.push(argum ents[i]);
}
alert(args.join ('\n'));
}

showArgs(items. item1[0], items.item1[1], items.item1[2]);

--
Rob

Aug 8 '06 #2

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

Similar topics

4
3551
by: laurenq uantrell | last post by:
I am trying to determine which of three stored procedure designs are fastest in the Query Analyzer: One query is a straight SELECT query with all desired rows and a dozen (tblName.RowName = @param or @param = Null) filters in the WHERE statement. One query populates a #Temp table with the UniqueIDs from the results of the SELECT query in...
5
6399
by: N | last post by:
Hi, I got an error during load on a couple of the tables. And it seems to be complaining that I'm running out of tempspace (possibly during index rebuild). Below is the load command and error. What I do not understand is why DB2 is trying to rebuild the index in TBS_STEMP03 even though I explicitly tell it to use TBS_STEMP01 in the load...
0
1495
by: chad kline | last post by:
i have searched around for an answer to this question, but haven't found a satisfactory answer. i understand things like mmap(2) can be used to quickly load a file - but it seems to be a function for "read-only" situtations. it doesn't appear to be useful in situations where editing must be done on the loaded file. the next fastest...
60
49026
by: Julie | last post by:
What is the *fastest* way in .NET to search large on-disk text files (100+ MB) for a given string. The files are unindexed and unsorted, and for the purposes of my immediate requirements, can't be indexed/sorted. I don't want to load the entire file into physical memory, memory-mapped files are ok (and preferred). Speed/performance is a...
3
7173
by: db2udbgirl | last post by:
Env: DB2 UDB 8.2, AIX 5.3 While trying to load data (73 Million rows, Medium size table uses 4K tablespace) into a table using cursor it fails with "SQL0964C The transaction log for the database is full. SQLSTATE=57011" But I felt that Load utility wont log any acvitities on the database. Here it what I tried to do db2 "declare c1 ...
3
3480
by: Sehboo | last post by:
I have to call a stored procedure which returns about 1000 rows with about 5 fields (most of them are int). What is the fastest way to load this data? if I just do DataTable.Load, then is it fast? or should I do something else? Thanks
4
2045
by: Chris Nethery | last post by:
Hello everyone, I have a challenging issue I need to overcome and was hoping I might gain some insights from this group. I am trying to speed up the process I am using, which is as follows: 1) I have roughly 700 files that are modified throughout the day by users, within a separate application
3
2049
by: Code Monkey | last post by:
DataTable loading a SqlDataReader (dt.Load())? Vanilla DataTable using SqlDataAdapter or SqlDataReader ? or is there a better way using Generics? If so, how? Essentially I want to get about 50-100 rows of data (2 columns) out of my database and use this is serveral places without caching it as the data could get updated several times...
3
2332
by: M.-A. Lemburg | last post by:
On 2008-08-07 20:41, Laszlo Nagy wrote: 1 It also very fast at dumping/loading lists, tuples, dictionaries, floats, etc. -- Marc-Andre Lemburg eGenix.com
0
7746
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
8179
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
7735
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
6356
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
5556
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
3698
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
2166
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1269
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
992
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.