[squeak-dev] The Trunk: Chronology-Core-ct.80.mcz

commits at source.squeak.org commits at source.squeak.org
Fri Jun 10 17:15:28 UTC 2022


Christoph Thiede uploaded a new version of Chronology-Core to project The Trunk:
http://source.squeak.org/trunk/Chronology-Core-ct.80.mcz

==================== Summary ====================

Name: Chronology-Core-ct.80
Author: ct
Time: 10 June 2022, 7:15:27.575345 pm
UUID: 1b24fec7-ca29-9e47-8951-34966ea11088
Ancestors: Chronology-Core-dtl.79

Merges fix-busyWait-precision:
	Fixes #busyWait for durations < 1 milliSecond. Since the original proposal (Chronology-Core-ct.67), the implementation had been moved from Duration to Delay (Chronology-Core-mt.71). However, Delay has only milliseconds precision, causing shorter durations to be handled as a delayDuration of 0 milliSeconds and leading to this erroneous output:
	
		[1 microSeconds busyWait] bench '6,240,000 per second. 160 nanoseconds per run. 0.67973 % GC time.'

Revision:
	Moves #busyWait implementation back to Duration and removes non-idiomatic Delay>>#busyWait without deprecation.

For more information, see: https://lists.squeakfoundation.org/pipermail/squeak-dev/2022-May/220378.html

=============== Diff against Chronology-Core-dtl.79 ===============

Item was changed:
  ----- Method: Duration>>busyWait (in category 'squeak protocol') -----
  busyWait
+ 	"BEWARE!! This method is more precise than #wait, but it sacrifices many CPU cycles for that precision. Also note that the GC runs more often. Also note that only processes with a higher priority can run while waiting.
+ 	
+ 	The following lists the precision (in milliseconds) of #wait on a Microsoft Surface Pro 6, Windows 10 21H1, OSVM 202104182333:
+ 		100 -> 100
+ 		50 -> 51.1 ... 102.2%
+ 		10 -> 11.6 ... 105.5% ... maybe use #busyWait
+ 		5 -> 5.93 ... 118.6% ... use #busyWait but check process priorities
+ 		1 -> 1.41 ... 141.0% ... use #busyWait but check process priorities
+ 	
+ 	As of July 2021, the shortest delay that we can guarantee on all platforms is still 1 millisecond as the value of #utcMicrosecondClock might not change any faster than that. For more information, see http://lists.squeakfoundation.org/pipermail/squeak-dev/2021-July/215928.html"
+ 	
+ 	"[5 milliSeconds busyWait] bench"
- 	"BEWARE!! This method is more precise than #wait, but it sacrifices many CPU cycles for that precision. Also note that only processes with a higher priority can run while waiting. See more detailed commentary in Delay >> #busyWait."
  
+ 	| proceedTime |
+ 	proceedTime := Time utcMicrosecondClock + self asMicroSeconds.
+ 	[Time utcMicrosecondClock >= proceedTime] whileFalse.!
- 	^ self asDelay busyWait!



More information about the Squeak-dev mailing list