Sviluppo4d.it
Sito indipendente di informazioni tecniche per sviluppatori 4th Dimension italiani  

Sviluppatori 4D

Utility 4D

Risorse 4D



4d logo
Naviga: Prev Next

Titolo: Metodo Benchmark v1.2.1*

Categoria: File Ultimo Aggiornamento: 17/05/04


Contiene una struttura dove propongo una base di benchmark delle versioni di 4D e delle piattaforme su cui viene lanciato.

In questo momento il codice è abbastanza approssimativo e non pesa allo stesso modo le varie parti del test (Export e Import sono sicuramente più significative delle altre funzioni in questo modo), inoltre testa solo il db engine del 4d mono, quindi create record, indexing, query, sort.

    `Method Benchmark
    `version 1.2.2 - 5 feb 2009
DEFAULT TABLE([Table])
If (Records in table>0)
  ALERT("You should launch this one on a new db")
  ALL RECORDS
  DELETE SELECTION
  FLUSH BUFFERS
Else
  $quantity:=Num(Request("How many record?";String(1000)))
  If (ok=1)
    $start:=Tickcount
    $firstStart:=$start
    `create record
    For ($i;1;$quantity)
      CREATE RECORD
      [Table]First:=String($i)
      For ($j;1;10)  `tre lettere
        [Table]Second:=[Table]Second+Char((Random%(122-97+1))+97)
      End for
      [Table]Numeric:=Random*Random
      SAVE RECORD
    End for
    FLUSH BUFFERS
    $benchmark_create:=Tickcount-$start
    $start:=Tickcount
    For ($i;1;$quantity)
      MESSAGE(String($i)+" on "+String($quantity))
      CREATE RECORD
      [Table]First:=String($i)
      For ($j;1;10)
        [Table]Second:=[Table]Second+Char((Random%(122-97+1))+97)
      End for
      [Table]Numeric:=Random*Random
      SAVE RECORD
    End for
    FLUSH BUFFERS
    $benchmark_createWithDialog:=Tickcount-$start
    $start:=Tickcount
    ALL RECORDS([Table])
    EXPORT TEXT([Table];"testexport.txt")
    $benchmark_export:=Tickcount-$start
    $start:=Tickcount
    IMPORT TEXT([Table];"testexport.txt")
    FLUSH BUFFERS
    $benchmark_import:=Tickcount-$start
    $start:=Tickcount
    SET INDEX([Table]First;True)
    $benchmark_index:=Tickcount-$start
    $start:=Tickcount
    QUERY([Table];[Table]First>"4")
    $benchmark_queryMedium:=Tickcount-$start
    $start:=Tickcount
    QUERY([Table];[Table]First<"9")
    $benchmark_queryLarge:=Tickcount-$start
    $start:=Tickcount
    QUERY([Table];[Table]First<"51";*)
    QUERY([Table]; & ;[Table]Second>"M")
    $benchmark_queryDouble:=Tickcount-$start
    $start:=Tickcount
    ORDER BY([Table];[Table]First;>)
    $benchmark_orderSingle:=Tickcount-$start
    $start:=Tickcount
    ORDER BY([Table];[Table]Second;>;[Table]First;<)
    $benchmark_orderDouble:=Tickcount-$start

    $benchmark_global:=Tickcount-$firstStart

    If (Compiled application)
      $compiled:=" Comp"
    Else
      $compiled:=" Inter"
    End if
    $result:="GLOBAL mm:ss:tt ["+String($quantity)+$compiled+"] "
    $result:=$result+Time string($benchmark_global/60)+", "+String($benchmark_global)+"tick"+Char(13)+Char(Line feed )
    ALERT($result)
    $result:=$result+"create "+Time string($benchmark_create/60)+", "+String($benchmark_create)+"tick"+Char(13)+Char(Line feed )
    $result:=$result+"withDialog "+Time string($benchmark_createWithDialog/60)+", "+String($benchmark_createWithDialog)+"tick"+Char(13)+Char(Line feed )
    $result:=$result+"export "+Time string($benchmark_export/60)+", "+String($benchmark_export)+"tick"+Char(13)+Char(Line feed )
    $result:=$result+"import "+Time string($benchmark_import/60)+", "+String($benchmark_import)+"tick"+Char(13)+Char(Line feed )
    $result:=$result+"index "+Time string($benchmark_index/60)+", "+String($benchmark_index)+"tick"+Char(13)+Char(Line feed )
    $result:=$result+"qryMedium "+Time string($benchmark_queryMedium/60)+", "+String($benchmark_queryMedium)+"tick"+Char(13)+Char(Line feed )
    $result:=$result+"qryLarge "+Time string($benchmark_queryLarge/60)+", "+String($benchmark_queryLarge)+"tick"+Char(13)+Char(Line feed )
    $result:=$result+"qryDouble "+Time string($benchmark_queryDouble/60)+", "+String($benchmark_queryDouble)+"tick"+Char(13)+Char(Line feed )
    $result:=$result+"orderSingle "+Time string($benchmark_orderSingle/60)+", "+String($benchmark_orderSingle)+"tick"+Char(13)+Char(Line feed )
    $result:=$result+"orderDouble "+Time string($benchmark_orderDouble/60)+", "+String($benchmark_orderDouble)+"tick"+Char(13)+Char(Line feed )
    SET TEXT TO CLIPBOARD($result)
    C_BLOB($BLOB)
    TEXT TO BLOB($result;$BLOB;3)
    $vhDocRef:=Create document("";"txt")  ` Save the document of your choice
    If (OK=1)  ` If a document has been created
      CLOSE DOCUMENT($vhDocRef)  ` We don't need to keep it open
      BLOB TO DOCUMENT(Document;$BLOB)
      ` Write the document contents
    End if
  End if
End if

Inviato da: Umberto Migliore Visite: 20289


PierPaolo Sichera 06/02/09 14:19:45
Ecco una versione aggiornata alla v11 SQL del metodo. Oltre ai comandi modificati:
- query e ordinamenti vengono eseguiti con e senza indici per testare la cache dei dati;
- il documento viene generato e salvato automaticamente.

    `Method Benchmark
    `version 1.2.3 - 6 feb 2009
DEFAULT TABLE([Table])
If (Records in table>0)
ALERT("You should launch this one on a new db")
ALL RECORDS
DELETE SELECTION
FLUSH BUFFERS
Else
$quantity:=Num(Request("How many record?";String(1000)))
If (ok=1)
$start:=Tickcount
$firstStart:=$start
  `create record
For ($i;1;$quantity)
CREATE RECORD
[Table]First:=String($i)
For ($j;1;10)  `tre lettere
[Table]Second:=[Table]Second+Char((Random%(122-97+1))+97)
End for
[Table]Numeric:=Random*Random
SAVE RECORD
End for
FLUSH BUFFERS
$benchmark_create:=Tickcount-$start
$start:=Tickcount
For ($i;1;$quantity)
MESSAGE(String($i)+" on "+String($quantity))
CREATE RECORD
[Table]First:=String($i)
For ($j;1;10)
[Table]Second:=[Table]Second+Char((Random%(122-97+1))+97)
End for
[Table]Numeric:=Random*Random
SAVE RECORD
End for



FLUSH BUFFERS
$benchmark_createWithDialog:=Tickcount-$start
$start:=Tickcount
ALL RECORDS([Table])
EXPORT TEXT([Table];"testexport.txt")
$benchmark_export:=Tickcount-$start
$start:=Tickcount
IMPORT TEXT([Table];"testexport.txt")
FLUSH BUFFERS
$benchmark_import:=Tickcount-$start

$start:=Tickcount
QUERY([Table];[Table]First>"4")
$benchmark_queryMedium:=Tickcount-$start
$start:=Tickcount
QUERY([Table];[Table]First<"9")
$benchmark_queryLarge:=Tickcount-$start
$start:=Tickcount
QUERY([Table];[Table]First<"51";*)
QUERY([Table]; & ;[Table]Second>"M")
$benchmark_queryDouble:=Tickcount-$start
$start:=Tickcount
ORDER BY([Table];[Table]First;>)
$benchmark_orderSingle:=Tickcount-$start
$start:=Tickcount
ORDER BY([Table];[Table]Second;>;[Table]First;<)
$benchmark_orderDouble:=Tickcount-$start

$start:=Tickcount
SET INDEX([Table]First;True)
$benchmark_index:=Tickcount-$start
$start:=Tickcount
QUERY([Table];[Table]First>"4")
$benchmark_queryMedium2:=Tickcount-$start
$start:=Tickcount
QUERY([Table];[Table]First<"9")
$benchmark_queryLarge2:=Tickcount-$start
$start:=Tickcount
QUERY([Table];[Table]First<"51";*)
QUERY([Table]; & ;[Table]Second>"M")
$benchmark_queryDouble2:=Tickcount-$start
$start:=Tickcount
ORDER BY([Table];[Table]First;>)
$benchmark_orderSingle2:=Tickcount-$start
$start:=Tickcount
ORDER BY([Table];[Table]Second;>;[Table]First;<)
$benchmark_orderDouble2:=Tickcount-$start

$start:=Tickcount
SET INDEX([Table]First;False)
$benchmark_index2:=Tickcount-$start



$benchmark_global:=Tickcount-$firstStart

If (Is compiled mode)
$compiled:=" Comp"
Else
$compiled:=" Inter"
End if
$result:="GLOBAL mm:ss:tt ["+String($quantity)+$compiled+"] "
$result:=$result+Time string($benchmark_global/60)+", "+String($benchmark_global)+"tick"+Char(13)+Char(Line feed )
ALERT($result)
$result:=$result+"create "+Time string($benchmark_create/60)+", "+String($benchmark_create)+"tick"+Char(13)+Char(Line feed )
$result:=$result+"withDialog "+Time string($benchmark_createWithDialog/60)+", "+String($benchmark_createWithDialog)+"tick"+Char(13)+Char(Line feed )
$result:=$result+"export "+Time string($benchmark_export/60)+", "+String($benchmark_export)+"tick"+Char(13)+Char(Line feed )
$result:=$result+"import "+Time string($benchmark_import/60)+", "+String($benchmark_import)+"tick"+Char(13)+Char(Line feed )
$result:=$result+"qryMedium "+Time string($benchmark_queryMedium/60)+", "+String($benchmark_queryMedium)+"tick"+Char(13)+Char(Line feed )
$result:=$result+"qryLarge "+Time string($benchmark_queryLarge/60)+", "+String($benchmark_queryLarge)+"tick"+Char(13)+Char(Line feed )
$result:=$result+"qryDouble "+Time string($benchmark_queryDouble/60)+", "+String($benchmark_queryDouble)+"tick"+Char(13)+Char(Line feed )
$result:=$result+"orderSingle "+Time string($benchmark_orderSingle/60)+", "+String($benchmark_orderSingle)+"tick"+Char(13)+Char(Line feed )
$result:=$result+"orderDouble "+Time string($benchmark_orderDouble/60)+", "+String($benchmark_orderDouble)+"tick"+Char(13)+Char(Line feed )
$result:=$result+"index "+Time string($benchmark_index/60)+", "+String($benchmark_index)+"tick"+Char(13)+Char(Line feed )
$result:=$result+"qryMedium "+Time string($benchmark_queryMedium2/60)+", "+String($benchmark_queryMedium2)+"tick"+Char(13)+Char(Line feed )
$result:=$result+"qryLarge "+Time string($benchmark_queryLarge2/60)+", "+String($benchmark_queryLarge2)+"tick"+Char(13)+Char(Line feed )
$result:=$result+"qryDouble "+Time string($benchmark_queryDouble2/60)+", "+String($benchmark_queryDouble2)+"tick"+Char(13)+Char(Line feed )
$result:=$result+"orderSingle "+Time string($benchmark_orderSingle2/60)+", "+String($benchmark_orderSingle2)+"tick"+Char(13)+Char(Line feed )
$result:=$result+"orderDouble "+Time string($benchmark_orderDouble2/60)+", "+String($benchmark_orderDouble2)+"tick"+Char(13)+Char(Line feed )
$result:=$result+"index drop "+Time string($benchmark_index2/60)+", "+String($benchmark_index2)+"tick"+Char(13)+Char(Line feed )
SET TEXT TO PASTEBOARD($result)
C_BLOB($BLOB)
TEXT TO BLOB($result;$BLOB;3)
$vhDocRef:=Create document($compiled+" "+String($quantity)+" "+String(Year of(Current date))+String(Month of(Current date))+String(Day of(Current date);"00")+Replace string(String(Current time;HH MM SS );":";"");"txt")  ` Save the document of your choice
If (OK=1)  ` If a document has been created
CLOSE DOCUMENT($vhDocRef)  ` We don't need to keep it open
BLOB TO DOCUMENT(Document;$BLOB)
SHOW ON DISK(Document)
  ` Write the document contents
End if
End if
End if

Se accedi con utente e password, puoi aggiungere dei commenti.


Accesso

User:
Pass: Accedi

Cerca

Se non trovi le informazioni che cerchi scrivi a aiuto@sviluppo4d.it

4D Principali

4D Discussioni

Faq random


Crediti

Dominio registrato da ZetaNet
Sito realizzato da Nexus srl
4D SQL 11.9.0 offerto da 4D & Italsoftware
Icone di FAMFAMFAM
Moderato da Umberto Migliore
329 utenti registrati

Pagina servita il 23/11/24 alle 05:59:17 Valid HTML 4.01! Valid CSS!

Mutuo Facile, iDigitalScout, iDigitalTags e altre app di Nexid srl per iPhone e iPad

Cidroid, distributore italiano lettori barcode per IOS Apple iPhone, iPod, iPad