Xojo Conferences
XDCMay2019MiamiUSA

Platforms to show: All Mac Windows Linux Cross-Platform

/Util/MemoryBlockMBS benchmark
Function:
Required plugins for this example: MBS Util Plugin
You find this example project in your Plugins Download as a Xojo project file within the examples folder: /Util/MemoryBlockMBS benchmark
This example is the version from Sun, 17th Mar 2012.
Project "MemoryBlockMBS benchmark.rbp"
Class App Inherits Application
Const kEditClear = "&Löschen"
Const kFileQuit = "Beenden"
Const kFileQuitShortcut = ""
End Class
Class Window1 Inherits Window
Control List Inherits Listbox
ControlInstance List Inherits Listbox
EventHandler Sub Open() me.ColumnAlignment(0)=me.AlignRight me.ColumnAlignment(1)=me.AlignRight me.ColumnAlignment(2)=me.AlignRight me.ColumnAlignment(3)=me.AlignRight End EventHandler
End Control
EventHandler Sub Open() test(2^4,1000) test(2^6,1000) test(2^8,1000) test(2^10,1000) // 1 KB test(2^12,1000) test(2^14,1000) test(2^16,1000) test(2^18,1000) test(2^20,100) // 1 MB test(2^22,100) test(2^24,100) test(2^26,10) test(2^28,10) test(2^30,10) // 1 GB List.AddRow "all" List.Cell(List.LastIndex,1)="all" List.Cell(List.LastIndex,2)=Format(SumRB,"0.00000") List.Cell(List.LastIndex,3)=Format(SumPlugin,"0.00000") End EventHandler
Sub test(size as integer, count as integer) #pragma DisableBackgroundTasks List.AddRow str(size) List.Cell(List.LastIndex,1)=str(Count) dim d as Double = Microseconds for i as integer=1 to count dim m as MemoryBlock = NewMemoryBlock(size) next dim e as Double = (Microseconds-d)/count List.Cell(List.LastIndex,2)=Format(e,"0.00000") sumRB=SumRB+e d = Microseconds for i as integer=1 to count dim m as new MemoryBlockMBS if m.Create(size)=false then MsgBox "Failed to create memoryblock of size "+stR(size) Return end if next e=(Microseconds-d)/count List.Cell(List.LastIndex,3)=Format(e,"0.00000") SumPlugin=SumPlugin+e End Sub
Property SumPlugin As Double
Property SumRB As Double
End Class
MenuBar MenuBar1
MenuItem FileMenu = "&Ablage"
MenuItem FileQuit = "#App.kFileQuit"
MenuItem EditMenu = "&Bearbeiten"
MenuItem EditUndo = "&Rückgängig"
MenuItem UntitledMenu1 = "-"
MenuItem EditCut = "&Ausschneiden"
MenuItem EditCopy = "&Kopieren"
MenuItem EditPaste = "&Einfügen"
MenuItem EditClear = "#App.kEditClear"
MenuItem UntitledMenu0 = "-"
MenuItem EditSelectAll = "&Alles auswählen"
End MenuBar
End Project

Feedback, Comments & Corrections

The items on this page are in the following plugins: MBS Util Plugin.




Links
MBS Xojo Plugins