On 3/20/12 2:12 PM, Paul McNett wrote:
> I was iterating all rows in my main bizobj, to run some updates on various
> children. By row 100, available memory was maxed out and my program slowed
> to a crawl. After putting in the flush code, I got through all 500 rows within
> a couple minutes.
>
> Now, the biz.saveAll() has eaten all the memory and is taking forever, I guess
> because it is iterating all rows and dutifully creating all those unneeded
> child cursors all over again. One step at a time.
FYI I reworked my update code from:
{{{
for rownum in biz.bizIterator(flushUnchangedCursors=True):
# do updates
biz.saveAll()
}}}
to:
{{{
for rownum in biz.bizIterator(flushUnchangedCursors=True):
# do updates
biz.save()
}}}
The total process time for 500 rows went from (killed the process after 30
minutes of
waiting for biz.saveAll()) to under two minutes.
I think the flushUnchangedCursors thing is really good for cases like this
where you
know you are iterating lots of rows and that you aren't ever going to revisit
any of
them.
Paul
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-dev
Searchable Archives: http://leafe.com/archives/search/dabo-dev
This message: http://leafe.com/archives/byMID/[email protected]