[Pythoncad-developer] New kernel
CAD Application entire developed in Python
Status: Beta
Brought to you by:
matteoboscolo
|
From: Matteo B. <mat...@bo...> - 2010-03-01 08:11:59
|
Hi Gertwin,
I had implemented the layer creation and now the entity are written in
the entity table, undo table and layer table ..
here you have some performance test
Create pycad object
Points:
Create n: 1 entity in : 0.0s
Create n: 10 entity in : 0.0s
Create n: 100 entity in : 0.02s
Create n: 1000 entity in : 0.18s
Create n: 10000 entity in : 1.77s
Create n: 100000 entity in : 18.09s
Segments:
Create n: 1 entity in : 0.0s
Create n: 10 entity in : 0.0s
Create n: 100 entity in : 0.02s
Create n: 1000 entity in : 0.22s
Create n: 10000 entity in : 2.03s
Create n: 100000 entity in : 21.91s
Script terminated.
Create pycad object
Points:
Create n: 1 entity in : 0.0s
Create n: 10 entity in : 0.01s
Create n: 100 entity in : 0.03s
Create n: 1000 entity in : 0.17s
Create n: 10000 entity in : 1.75s
Create n: 100000 entity in : 18.58s
Segments:
Create n: 1 entity in : 0.0s
Create n: 10 entity in : 0.0s
Create n: 100 entity in : 0.02s
Create n: 1000 entity in : 0.23s
Create n: 10000 entity in : 2.09s
Create n: 100000 entity in : 22.44s
Script terminated.
At the end of the script we have the following entity in the db
pycadent 691117
pycadrel 691115
pycadundo 56 <- this is due to the bulk operation that just store an id
for a single bulk operation.
As you can see the performance are stable even if we already have more
that 690000 entity...
I think for the normal operation we do not have any problem for speed
storing entity.
I would like to do more test and see what append if we have more that
2.000.000 entity .. that could be the case with all the undo and so an.
as you can see the time for storing segment is more than storing
points ...
may be this time is due to the pickling ...
now you can get the entire child entity id from the kernel using the
pycadkernel.getLayerChild(LayerName)
def getChildrenIds(self,entityParentId):
"""
Get the children id of a relation
"""
_outObj=[]
_sqlGet="""SELECT pycad_child_id
FROM pycadrel
WHERE pycad_parent_id=%s"""%str(entityParentId)
_rows=self.makeSelect(_sqlGet)
_dbEntRow=self.makeSelect(_sqlGet)
if _dbEntRow is not None:
for _row in _dbEntRow:
_outObj.append(_row[0])
return _outObj
Get n: 691115 layer entity in : 1.33s
this is the time that it need to do such an operation.
Fill free to add function to my class if you need it ..
This is the first version .. so please add comment and improvements on
my work..
Regards,
Matteo
|