🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: comp.lang.oberon
2 messages
2 total messages Started by Doug Danforth Fri, 12 Apr 1996 15:13
Oberon Task Statistics (Windows)
#1317
Author: Doug Danforth
Date: Fri, 12 Apr 1996 15:13
71 lines
2536 bytes
Folks,
  Have you ever wondered how much time is consumed by a cycle
of an Oberon task loop?  I've run several small programs and
would like to report the following results for Windows 95 Oberon
V4:

One tick:  	1 millisecond.
TightLoop: 	10,000 cycles/tick ( 60 MHZ Pentium)
  "             30,000    "         150  "    "
Task:      	50 ticks
Others.Wait:	50 ticks


Where by TightLoop I mean
	lastTime := Oberon.Time();
	i:=0; WHILE i<10000000 DO INC(i) END;
	time := Oberon.Time();

and by Task I mean

	PROCEDURE Start;
	BEGIN
	(* install Oberon.Task timer *)
	END Start;
	
	PROCEDURE Timer;
	BEGIN
	(* measure time from last activation of me *)
	END Timer;
	
	PROCEDURE Stop;
	BEGIN
	(* remove timer task *)
	END Stop;

And by Others.Wait I mean

	PROCEDURE Wait;
	BEGIN
	  IF Windows.GetMessage THEN 
	    Windows.TranslateMessage;
	    Windows.DispatchMessage;
	  END
	END Wait;

We see that the Oberon loop is totally dominated by the Windows
message handling mechanism (I belive WinV4 actually uses a
Windows Timer to call itself?).

This means that splitting a procedure into two task introduces 500,000 to 
one overhead! (2x -> (T+x) + (T+x)  where T >>> x).

I had not noticed this massive constraint until I switched from
Win3.11 to Win95 and my speech recording quality degraded (I am
pumping bytes into a modem which must be done in "real-time").
(I no longer have Win3.11 available so can not check the change
in task swap time).

Final note: The values of "50" are average, ranging from lows of
4 to highs of 110.

-Doug
-- 
-----------------------------------------------------------------------------
  Douglas G. Danforth, Ph.D.                       danforth@csli.stanford.edu
  Visiting Scholar                                 (415)723-2487 x332 vox  
  Applied Speech Technology Lab                    (415)725-2166 fax
  Center for the Study of Language and Information
  Ventura Hall                    
  Stanford University, Stanford CA.  94305-4115             
-----------------------------------------------------------------------------
Re: Oberon Task Statistics (Windows)
#1337
Author: zeller
Date: Tue, 16 Apr 1996 07:18
49 lines
1587 bytes
With the attached modules I mesured the following values (Win95 on P120)

	1.38E+4 Tasks/s using the standard System 3 for Windows
	1.24E+5 Taks/s using my experimental Multithreaded System 3 For Winows 95

In the multithreaded versions the Oberon.Loop does not poll the windows message queue.

Emi Zeller


MODULE TestTasks;
	IMPORT Input, Texts, Oberon;

	VAR
		T: Oberon.Task;
		count, time: LONGINT;
		W: Texts.Writer;

	PROCEDURE *Timer(me: Oberon.Task);
	BEGIN
		INC(count)
	END Timer;

	PROCEDURE Start*;
	BEGIN
		IF T = NIL THEN
			NEW(T); T.safe := FALSE; T.time := 0; T.handle := Timer;
			count := 0; time := Input.Time();
			Oberon.Install(T)
		END
	END Start;

	PROCEDURE Stop*;
	BEGIN
		IF T # NIL THEN
			time := Input.Time()-time;
			Oberon.Remove(T); T := NIL;
			Texts.WriteReal(W, count/(time/Input.TimeUnit), 20); Texts.WriteLn(W);
			Texts.Append(Oberon.Log, W.buf)
		END
	END Stop;

BEGIN
	T := NIL; Texts.OpenWriter(W)
END TestTasks.

TestTasks.Start
TestTasks.Stop
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads