> On Jul 25, 2017, at 6:02 PM, Jeffrey Kain via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> So why not BLOBs? Why not pictures, or text variables? Why does C_OBJECT 
> flaunt the limited scoping abilities we have in 4D? The only reason I can 
> think of is because an object can contain references to other other objects, 
> and it would get really hard to explain what to do with all the parent object 
> references if a child object 10 layers deep got modified.


Also note that when objects referencing other objects have a cycle (the same 
object included in more than one path) strange performance issues popup. The 
execution time for the method below increases 40 times when a cycle is added. 
Tested 15.4 Mac.

John DeSoi, Ph.D.



C_BOOLEAN($1;$executeBug)

If (Count parameters>=1)
        $executeBug:=$1
Else 
        $executeBug:=True
End if 


C_LONGINT($iCol;$iRow;$rowCount;$ms;$fast;$slow;$total)
C_OBJECT($oCursor;$oAllRows;$oRow;$oName)

$colCount:=5
ARRAY OBJECT($aCol;$colCount)

For ($iCol;1;$colCount)
        OB SET($aCol{$iCol};"name";"name "+String($iCol);"number";$iCol)
End for 
OB SET ARRAY($oCursor;"columns";$aCol)

$rowCount:=3000
For ($iRow;1;$rowCount)
        CLEAR VARIABLE($oRow)
        For ($iCol;1;$colCount)
                OB SET($oRow;String($iCol);String($iCol))
        End for 
        OB SET($oAllRows;String($iRow);$oRow)
End for 

OB SET($oCursor;"rows";$oAllRows)
$oAllRows:=OB Get($oCursor;"rows")

$fast:=MAXLONG
$slow:=0
$total:=Milliseconds

For ($iRow;1;$rowCount)
        $ms:=Milliseconds
        $oRow:=OB Get($oAllRows;String($iRow))
        $ms:=Milliseconds-$ms
        If ($ms<$fast)
                $fast:=$ms
        End if 
        If ($ms>$slow)
                $slow:=$ms
        End if 
        
          //If this is executed, access on $oAllRows starts taking up to 40 
times longer.
        If ($executeBug & ($iRow=100))
                For ($iCol;1;$colCount)
                        OB SET($oName;OB Get($aCol{$iCol};"name");$aCol{$iCol})
                End for 
                OB SET($oCursor;"names";$oName)
        End if 
        
End for 

$total:=Milliseconds-$total

ALERT(String($total)+" ms, range "+String($fast)+"-"+String($slow))

If (Count parameters=0)
        EXECUTE METHOD(Current method name;*;False)
End if 


**********************************************************************
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**********************************************************************

Reply via email to