Skip to content

Commit

Permalink
Add UI benchmark
Browse files Browse the repository at this point in the history
  • Loading branch information
fniephaus committed Apr 11, 2021
1 parent b731d1c commit 3986420
Show file tree
Hide file tree
Showing 8 changed files with 67 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,6 @@ Graal runtime inspect.
RPlotMorph example.
-
TruffleSqueakUtilities setUpImage.
TruffleSqueakUtilities setUpUIBenchmark.
-
', Utilities commonRequestStrings contents
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
image creation
setUpUIBenchmark
Preferences setFlag: #higherPerformance toValue: true.
DisplayScreen
fullScreenOff;
setNewScreenSize: 1024 @ 768.

World submorphs
select: [ :ea | ea isKindOf: SimpleButtonMorph ]
thenDo: [ :ea | ea abandon ].
ReleaseBuilder deleteAllWindows.

World dockingBars do: [ :b | b addMorph: UIBenchmarkInfoMorph new after:
(b submorphs detect: [:ea | ea isKindOf: AlignmentMorph]) ].

BouncingAtomsMorph new
addAtoms: 70; "100 atoms"
extent: 800@600;
center: World center;
openInWorld.

Smalltalk garbageCollect.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"class" : {
"adjustAppsMenu" : "fn 3/30/2021 10:24",
"adjustDoMenu" : "fn 3/30/2021 10:30",
"adjustDoMenu" : "fn 4/11/2021 13:10",
"arrayStatistics" : "fn 1/27/2021 15:25",
"getAllLayouts" : "fn 2/1/2021 14:59",
"layoutStatistics" : "fn 1/27/2021 15:26",
Expand All @@ -19,6 +19,7 @@
"primitiveGetVMObject:" : "fn 3/21/2020 16:23",
"registerInWorldMenu" : "fn 3/30/2021 10:31",
"setUpImage" : "fn 3/30/2021 10:18",
"setUpTestImage" : "fn 3/30/2021 09:45" },
"setUpTestImage" : "fn 3/30/2021 09:45",
"setUpUIBenchmark" : "fn 4/11/2021 13:30" },
"instance" : {
} }
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
initialization
initialize
super initialize.
self color: Color blue.
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
stepping and presenter
step
| now mSecs framesPerSec queueSize newContents |
framesSinceLastDisplay := framesSinceLastDisplay + 1.
now := Time millisecondClockValue.
mSecs := now - lastDisplayTime.
(mSecs > 500 or: [mSecs < 0 "clock wrap-around"]) ifTrue:
[framesPerSec := (framesSinceLastDisplay * 1000) // mSecs.
queueSize := Graal runtime ifNil: [ 'n/a' ] ifNotNil: [ :r | r getCompilationQueueSize asNumber ].
newContents := 'Frame rate: ', framesPerSec printString, ' fps / Graal queue: ', queueSize.
self contents: newContents.
FileStream stdout nextPutAll: newContents; cr; flush.
lastDisplayTime := now.
framesSinceLastDisplay := 0]
ifFalse:
["Ensure at least one pixel is drawn per frame"
Preferences higherPerformance ifTrue: [self invalidRect: (self position extent: 1@1)]]
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"class" : {
},
"instance" : {
"initialize" : "fn 4/11/2021 13:07",
"step" : "fn 4/11/2021 13:08" } }
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"category" : "TruffleSqueak-Utilities",
"classinstvars" : [
],
"classvars" : [
],
"commentStamp" : "",
"instvars" : [
],
"name" : "UIBenchmarkInfoMorph",
"pools" : [
],
"super" : "FrameRateMorph",
"type" : "normal" }

0 comments on commit 3986420

Please sign in to comment.