flex-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mark goldin <markzolo...@gmail.com>
Subject Re: A script has executed for longer than ....
Date Fri, 26 Jun 2015 15:39:24 GMT
It's getting called just once.

On Fri, Jun 26, 2015 at 10:33 AM Alex Harui <aharui@adobe.com> wrote:

> What work is done in processXML?  Step through it and make sure you are
> done quickly and it gets called many times.
>
> On 6/26/15, 2:04 AM, "mark goldin" <markzolotoy@gmail.com> wrote:
>
> >Ok, I got it running but it still timing out.
> >Here is some code:
> >
> >public function result(data:Object):void
> >{
> > var re:ResultEvent = ResultEvent(data);
> >thread = new
> >PseudoThread(UIComponent(Application.application).systemManager,
> >processXML, re.result.resultData);
> >}
> >private function processXML(resultData:XMLList):void
> >
> >Did not change anything in PseudoThread.
> >
> >On Thu, Jun 25, 2015 at 3:39 PM Alex Harui <aharui@adobe.com> wrote:
> >
> >> In Flex 3, mx.core.Application.application from anywhere should give you
> >> access to the Application and thus its stage.
> >>
> >> In Flex 4, use FlexGlobals.topLevelApplication.
> >>
> >> -Alex
> >>
> >> On 6/25/15, 10:59 AM, "mark goldin" <markzolotoy@gmail.com> wrote:
> >>
> >> >Alex, I need to use it from a command class that does not have
> >> >systemManager or its stages. How do I go about it?
> >> >
> >> >On Thu, Jun 25, 2015 at 11:34 AM Javier Guerrero García
> >> ><javi.gg@gmail.com>
> >> >wrote:
> >> >
> >> >> More on that:
> >> >>
> >> >>
> >> >>
> >>
> >>
> http://www.jamesward.com/2008/11/21/drunk-on-software-episode-3-performan
> >> >>ce-pitfalls-of-flexs-arraycollection/
> >> >>
> >> >> On Thu, Jun 25, 2015 at 6:29 PM, Javier Guerrero García
> >> >><javi.gg@gmail.com
> >> >> >
> >> >> wrote:
> >> >>
> >> >> > Hi Mark:
> >> >> >
> >> >> > A long shot here: are you sure that, while you are processing
the
> >>XML,
> >> >> > you're NOT triggering constant UI updates on each operation? For
> >> >> instance:
> >> >> > if after processing each XML item, you are adding the final result
> >>to
> >> >>an
> >> >> > ArrayCollection, and you have some rendering component bound to
> >>that
> >> >> > ArrayCollection, that could cause a total repaint of the item
> >> >>renderers
> >> >> FOR
> >> >> > EACH XML ITEM processed, hence causing the timeout. Something
> >>similar
> >> >> > happened to me a while ago, and after noticing and solving it,
I
> >>can
> >> >>say
> >> >> > that 60 seconds are more than enough to process a few hundreds
of
> >> >> thousand
> >> >> > XML items, and unless your XML is REALLY huge that should be
> >>enough :)
> >> >> >
> >> >> > If that applies, the obvious workaround is:
> >> >> >
> >> >> > 1. Do all your updates and additions on a new ArrayCollection
(not
> >>on
> >> >>the
> >> >> > one bound to the component's dataProvider), and then just swap
the
> >> >> > dataProvider of the component to point to the newly populated
> >> >> > ArrayCollection instead
> >> >> > 2. Or call "thefunctionthatdisabledautoupdates" in advance (don't
> >> >> remember
> >> >> > the exact name right now) on the bound arraycollection before
> >>starting
> >> >> > processing your XML, modify/update your arraycollection items,
and
> >> >>then
> >> >> > enabling it afterwards.
> >> >> >
> >> >> > P.S. "myCollection.disableAutoUpdate(); ", that was it :)
> >> >> >
> >> >>
> >> >>
> >>
> >>
> http://help.adobe.com/en_US/flex/using/WS2db454920e96a9e51e63e3d11c0bf668
> >> >>d2-7fe7.html
> >> >> >
> >> >> > P.P.S. If none of that applies.... would some kind of "pagination"
> >>on
> >> >>the
> >> >> > UI solve it?
> >> >> >
> >> >> > On Thu, Jun 25, 2015 at 3:52 PM, mark goldin
> >><markzolotoy@gmail.com>
> >> >> > wrote:
> >> >> >
> >> >> >> I have a large xml data that UI needs to process. I am getting
the
> >> >>above
> >> >> >> message about timing out. Not sure I can break my function
into
> >> >>smaller
> >> >> >> pieces. Any other idea?
> >> >> >>
> >> >> >> Thanks
> >> >> >>
> >> >> >
> >> >> >
> >> >>
> >>
> >>
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message