Hi Gertwin
> I already tried to free the list of objects.
> After I created the display list I added a line like
> _outObj = []
may be you can try with del(_outObj) this will delete the variable from
python but we still have the pick of memory consumption.
> Maybe a solution is when the function getEntityFromTypeArray not
> returns an list with objects but a list with entity id's.
> When I go through the list with id's, I can call the pycadkernel for a
> object with an id as parameter.
> This way only one object at the time is constructed (and destroyed).
> What I mean is split the function getEntityFromTypeArray in two
> functions, the first function gives a list of entity id's, the
> function gives an object for a id.
I made this modification ..
Instead of using the getEntityFromTypeArray use the
rows=kernel.getMultiFilteredEntity(entityTypeArray)
and to convert each row in an object use the
obj=kernel.convertRowToDbEnt(rows[i])
a simple example could be:
rows=kernel.getMultiFilteredEntity(entityTypeArray)
for row in rows:
obj=kernel.convertRowToDbEnt(rows[i])
# do your stuff
> Question:
> The extra 140 mb. which is used by the wx application is for building
> the display list in memory (and a few mb's for wx itself).
> Do you think 140 mb is too much, if so we can try OpenGL.
> I don't think it is to much for such a large drawing.
It's not too much for such a file ...
I think that we are in a right way ..
Regards,
Matteo
>
> Regards,
> Gertwin
>
>
>
>
> 2010/4/2 Matteo Boscolo <mat...@bo...>:
> > Hi Gertwin,
> >
> > Have any comment to this email?
> >
> > How we can improve this function to perform better display list ..
> >
> >
> > Regard,
> > Matteo
> >
> >
> >
> > ---------- Doorgestuurd bericht ----------
> > From: Matteo Boscolo <mat...@bo...>
> > To: Geon Gertwin <ger...@gm...>
> > Date: Sat, 27 Mar 2010 09:54:57 +0100
> > Subject: Re: [Pythoncad-developer] Test Performance
> > I did the test and lookign at this function
> > def getEntityFromTypeArray(self, typeArray):
> > """
> > get entitys from an array of type
> > """
> > _outObj=[]
> > _dbEntRow=self.getMultiFilteredEntity(entityTypeArray=typeArray)
> >
> > -->> here we have 31 Mb and all the entity are in the _dbEntRow
> >
> > for _row in _dbEntRow:
> > _style=_row[4]
> > _dumpObj=pickle.loads(str(_row[3]))
> > _objEnt=PyCadEnt(_row[2],_dumpObj,_style,_row[1])
> > _objEnt.state=_row[5]
> > _objEnt.index=_row[6]
> > _objEnt.visible=_row[7]
> > _objEnt.updateBBox()
> > _outObj.append(_objEnt)
> > return _outObj
> >
> > --> here we have 400 Mb approximatively
> >
> > Regards,
> > Matteo
> >
> >
> >
> > On Sat, 2010-03-27 at 09:05 +0100, Matteo Boscolo wrote:
> >> Hi Gerwin,
> >> I did some performance test on the huge dxf layout that you have send to
> >> me.
> >>
> >> This is the result of memory charge
> >>
> >> with wx 475 Mb
> >> with text_interface 338 Mb
> >>
> >> I will look better to it, but at the first glance I can surly say that
> >> all this memory consumption is due to the kernel.getAllDrawingEntity()
> >> function.
> >>
> >> This function create all the geometrical object in memory and of course
> >> with about 227250 object created the memory consumption is very hight.
> >> Using this method we have replicated R37 ... that is not what we are try
> >> to do..
> >>
> >> we need to avoid to use this method for get all the entity for the
> >> display list..
> >>
> >> We need to load the entity just for geometrical operation .. nothing
> >> else... as we have discuss in some mail ...
> >>
> >> May be you can destroy elements from the array after generating the
> >> display list..so the python garbage collection remove it from the
> >> memory..
> >> But of course remain a pick of memory ..
> >>
> >> or may be the problem is that I do not close the cursor after giving to
> >> you the array ..
> >>
> >> I will do some more test and let you know...
> >>
> >> Do you have any alternative way to create the display list without using
> >> the kernel.getAllDrawingEntity() function ?
> >>
> >> Regards,
> >> Matteo
> >>
> >>
> >>
> >>
> >> ------------------------------------------------------------------------------
> >> Download Intel® Parallel Studio Eval
> >> Try the new software tools for yourself. Speed compiling, find bugs
> >> proactively, and fine-tune applications for parallel performance.
> >> See why Intel Parallel Studio got high marks during beta.
> >> http://p.sf.net/sfu/intel-sw-dev
> >> _______________________________________________
> >> Pythoncad-developer mailing list
> >> Pyt...@li...
> >> https://lists.sourceforge.net/lists/listinfo/pythoncad-developer
> >>
> >
> >
> >
>
|