David T. Lewis uploaded a new version of System to project The Inbox:
http://source.squeak.org/inbox/System-dtl.1207.mcz==================== Summary ====================
Name: System-dtl.1207
Author: dtl
Time: 22 December 2020, 4:14:44.828557 pm
UUID: 55d26f8d-673a-4927-8718-a6680425562d
Ancestors: System-dtl.1206
Check #isLowerPerformance on first reference and compute it based on simple benchmarks. Replaces previous policy based on platform identifiers.
=============== Diff against System-dtl.1206 ===============
Item was changed:
Object subclass: #SmalltalkImage
instanceVariableNames: 'globals'
+ classVariableNames: 'EndianCache LastImageName LastQuitLogPosition LastStats LowSpaceProcess LowSpaceSemaphore MemoryHogs ShutDownList SlowPlatform SourceFileVersionString StartUpList StartupStamp WordSize'
- classVariableNames: 'EndianCache LastImageName LastQuitLogPosition LastStats LowSpaceProcess LowSpaceSemaphore MemoryHogs ShutDownList SourceFileVersionString StartUpList StartupStamp WordSize'
poolDictionaries: ''
category: 'System-Support'!
!SmalltalkImage commentStamp: 'dtl 3/6/2010 14:00' prior: 0!
I represent the current image and runtime environment, including system organization, the virtual machine, object memory, plugins and source files. My instance variable #globals is a reference to the system dictionary of global variables and class names.
My singleton instance is called Smalltalk.!
Item was changed:
----- Method: SmalltalkImage class>>startUp: (in category 'class initialization') -----
startUp: resuming
resuming ifTrue:
[LastStats := nil.
+ SlowPlatform := nil.
+ SystemChangeNotifier uniqueInstance notify: Smalltalk ofAllSystemChangesUsing: #event:]!
- SystemChangeNotifier uniqueInstance notify: Smalltalk ofAllSystemChangesUsing: #event:]!
Item was changed:
----- Method: SmalltalkImage>>isLowerPerformance (in category 'system attributes') -----
isLowerPerformance
+ "Some operations - TestCases for example - need an idea of the typical performance
+ of the system on which they are being performed."
+ ^ SlowPlatform
+ ifNil: [ SlowPlatform := (Time millisecondsToRun:[ 25 benchFib ]) > 200
+ or: [ (Time millisecondsToRun: [ 64 benchmark ]) > 200 ]]!
- "Some operations - TestCases for example - need an idea of the typical performance of the system on which they are being performed. For now we will simply assert that running on an ARM cpu or as a SqueakJS instance is enough of a discriminator. Options for the future might also involve whether the vm is a full Cog or Sisata system, even actually measuring the performance at some point to be sure"
- ^ (self platformSubtype beginsWith: 'arm') "Raspberry PI for example"
- or: [self platformName = 'JS'] "SqueakJS"!