Re: [flexcoders] Re: Actionscript SAX Parser ?

2007-06-01 Thread Peter Hall

For my use-case, the XML is not large at all (~20k). However, the user
experience of having something displayed immediately, and the remaining
content displaying as it loads, is really noticeable. Even if the difference
is sub-second. It's small things that make the application feel faster.

Peter


On 6/1/07, Gordon Smith [EMAIL PROTECTED] wrote:


   I'd be interested to know what your use case is that requires a SAX
parser. How large is your XML? Did you run into a memory or performance
problem with AS3's E4X capabilities?

- Gordon

 --
*From:* flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] *On
Behalf Of *powertool786
*Sent:* Thursday, May 31, 2007 6:21 AM
*To:* flexcoders@yahoogroups.com
*Subject:* [flexcoders] Re: Actionscript SAX Parser ?

 The XML4JS SAX Parser seems to be written pretty reasonably... I think
I'll have a go at automatically porting it to AS3.0 with a Perl script.

If it works at all, I'll continue by doing some profiling, then fill
out the API a little.

I don't need much working for my purposes.

-David

--- In flexcoders@yahoogroups.com flexcoders%40yahoogroups.com, Peter
Hall [EMAIL PROTECTED] wrote:
 Just last week, I had an unsuccessful look around for an AS3 SAX
 parser. I thought about making one myself, but couldn't justify the
 time to fit inside the project schedule.

 Peter

 



[flexcoders] Re: Actionscript SAX Parser ?

2007-06-01 Thread powertool786
--- In flexcoders@yahoogroups.com, Gordon Smith [EMAIL PROTECTED] wrote:
 I'd be interested to know what your use case is that requires a SAX
 parser. 

In my application, I had two list/search forms which:
  * query billing-related events (fairly static)
  * query/rank/prioritise tickets in a ordering/support system

In both cases, there can be anywhere between 200 and 50,000 rows
returned from a database for each query, sent to the Flex client via
SOAP. (That number could grow to 100,000 in three years.)

It's *not* useful to have paged views of that many results in the
client application; it makes it much more difficult for the user to
skim the records and have a good mental picture of what has occurred
in the back-end systems.

Also, the user wants to type/customise a query, and expects to get
back *something* within 1 second, even if the full results take much
longer to arrive.

 How large is your XML? Did you run into a memory or
 performance problem with AS3's E4X capabilities?

AS3 on my laptop (Athlon64-2700, WinXP, Firefox 2, non-debug) takes 70
seconds to retrieve the full SOAP response (5 rows, 8 variable
length string columns - about 14MB - over 1-3mbit broadband). I assume
about 1 second of error in this measurement because I could only
measure when the server stopped sending data. 

After the response has been fully sent, the Flex client takes 10-12
seconds (seems to depend on system memory utilisation) to parse,
E4Xify, bind and update that data into a very simple DataGrid component. 

The performance of the DataGrid component is actually pretty damn good
(even with 10,000+ rows)... no complaints there.

I'm *not* complaining about the AS3 E4X parser's performance... it's
remarkable that it does it that fast (my perl client using a c-based
XML parser library only does it 3.5 times faster on average).

I realise that my example is extreme, but in *many* use cases the data
takes quite a bit longer to download than to parse... if the whole
document must be parsed, an unacceptable amount of time elapses
between sending the query, and getting something back to the user.

The second important issue is memory usage. Very unscientific viewing
of the task manager leads me to believe that the Flash plug-in
allocates about 34MB while parsing the XML response. 34MB is not so
bad when objectifying a document of that size... but it does have a
large performance impact... it makes *much* more sense to parse the
document with a constant 4-12kbyte buffered approach.

- I'd skip this part if I were you -
Years of service software development has led me to construct my
service APIs so that they return data in a streaming fashion - whether
the client supports it or not - because it provides much greater
flexibility in how that data is used by different client applications.

All databases in almost all server-side languages have APIs allowing
the user to perform a query then iterate over the result set, only
retrieving each row from the database as it is needed. It is well
accepted that this results in much higher performance for non-trivial
amounts of data. 

Web-service (say SOAP) libraries that allow streaming are relatively
new, but have been available to Java developers for at least 5 years,
and to Python developers for at least 3 years. (I use Perl... I
actually had to modify SOAP::Lite to make streaming work).
---

Basically, with large amounts of data if you retrieve the full
response it takes too long to finish and allocates too much memory...
both degrade the user experience.

-David.










[flexcoders] Re: Actionscript SAX Parser ?

2007-05-31 Thread powertool786
The XML4JS SAX Parser seems to be written pretty reasonably... I think
I'll have a go at automatically porting it to AS3.0 with a Perl script.

If it works at all, I'll continue by doing some profiling, then fill
out the API a little. 

I don't need much working for my purposes.

-David

--- In flexcoders@yahoogroups.com, Peter Hall [EMAIL PROTECTED] wrote:
 Just last week, I had an unsuccessful look around for an AS3 SAX 
 parser. I thought about making one myself, but couldn't justify the
 time to fit inside the project schedule.
 
 Peter




RE: [flexcoders] Re: Actionscript SAX Parser ?

2007-05-31 Thread Gordon Smith
I'd be interested to know what your use case is that requires a SAX
parser. How large is your XML? Did you run into a memory or performance
problem with AS3's E4X capabilities?
 
- Gordon



From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of powertool786
Sent: Thursday, May 31, 2007 6:21 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Re: Actionscript SAX Parser ?



The XML4JS SAX Parser seems to be written pretty reasonably... I think
I'll have a go at automatically porting it to AS3.0 with a Perl script.

If it works at all, I'll continue by doing some profiling, then fill
out the API a little. 

I don't need much working for my purposes.

-David

--- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com
, Peter Hall [EMAIL PROTECTED] wrote:
 Just last week, I had an unsuccessful look around for an AS3 SAX 
 parser. I thought about making one myself, but couldn't justify the
 time to fit inside the project schedule.
 
 Peter



 


Re: [flexcoders] Re: Actionscript SAX Parser ?

2007-05-30 Thread Peter Hall

Just last week, I had an unsuccessful look around for an AS3 SAX parser. I
thought about making one myself, but couldn't justify the time to fit inside
the project schedule.

Peter


On 5/29/07, Claus Wahlers [EMAIL PROTECTED] wrote:


  Paul DeCoursey wrote:

 Nobody on this high-volume list wants/needs a SAX parser?
 Thats just crazy. I'm going back to .NET ;)

 Actually, this is something that I have been interested in. I did see
 someone had one written for AS2, I don't recall the link. The code
 did not translate well to AS3 and was far from complete. I have yet
 to find it totally necessary to start working on my own solution. Most
 of the time pagination and xslt on th server has been enough. I could
 see this being more valuable for Apollo.

You're probably refering to the AS2 SAX implementation by Jim Cheng:
http://tinyurl.com/yqo87x

I myself have been working on porting Xerces-J to AS3 for a while now,
although i plan to use the built in parsers of Flash Player with it (i'm
primarily interested in a stable and compliant DOM 3 implementation).
This doesn't mean having a compliant SAX parser with it would hurt - to
the contrary.

If anyone would like to help me on this (greatly apprechiated), please
feel free to contact me directly.

Thanks,
Claus.
 



[flexcoders] Re: Actionscript SAX Parser ?

2007-05-28 Thread powertool786
Nobody on this high-volume list wants/needs a SAX parser? 
Thats just crazy. I'm going back to .NET ;)



[flexcoders] Re: Actionscript SAX Parser ?

2007-05-28 Thread Paul DeCoursey
--- In flexcoders@yahoogroups.com, powertool786
[EMAIL PROTECTED] wrote:

 Nobody on this high-volume list wants/needs a SAX parser? 
 Thats just crazy. I'm going back to .NET ;)



Actually, this is something that I have been interested in.  I did see
someone had one written for AS2, I don't recall the link.  The code
did not translate well to AS3 and was far from complete.  I have yet
to find it totally necessary to start working on my own solution. Most
of the time pagination and xslt on th server has been enough.  I could
see this being more valuable for Apollo.

I think that you will find most people either don't understand the
benefits of SAX, especially since most casual developers rarely access
it directly, or the apps the are working on are tightly coupled with a
server technology that makes it unnecessary to have in flex.





Re: [flexcoders] Re: Actionscript SAX Parser ?

2007-05-28 Thread Claus Wahlers
Paul DeCoursey wrote:

 Nobody on this high-volume list wants/needs a SAX parser? 
 Thats just crazy. I'm going back to .NET ;)
 
 Actually, this is something that I have been interested in.  I did see
 someone had one written for AS2, I don't recall the link.  The code
 did not translate well to AS3 and was far from complete.  I have yet
 to find it totally necessary to start working on my own solution. Most
 of the time pagination and xslt on th server has been enough.  I could
 see this being more valuable for Apollo.

You're probably refering to the AS2 SAX implementation by Jim Cheng:
http://tinyurl.com/yqo87x

I myself have been working on porting Xerces-J to AS3 for a while now, 
although i plan to use the built in parsers of Flash Player with it (i'm 
primarily interested in a stable and compliant DOM 3 implementation). 
This doesn't mean having a compliant SAX parser with it would hurt - to 
the contrary.

If anyone would like to help me on this (greatly apprechiated), please 
feel free to contact me directly.

Thanks,
Claus.