Re: Comparison of ex.exe and exw.exe

new topic     » goto parent     » topic index » view thread      » older message » newer message

DB James wrote:
> I ran the following program first as a .ex file and then as a .exw file:
> 
> }}}
<eucode>
> --with trace
> integer fn
> atom ctr,t,tt
> sequence powersOfTwo
> 
> 
> procedure PowersOfTwo(integer maxPower) 
> 	--set up sequence of the powers of two
> 	powersOfTwo={}
> 	for i = maxPower to 0 by -1 do
> 		powersOfTwo&=power(2,i)
> 	end for
> end procedure
> 
> 
> fn=open("c:\\euphoria\\test.txt","a")
> printf(fn,"%s",{"--------------------------\n"})
> printf(fn,"%s",{"Program run as an .ex file\n"})
> printf(fn,"%s",{"--------------------------\n"})
> 
> for i=1 to 10 do
> 	ctr=0
> 	tt=0
> 	t=time()
> 	while tt<10 do
> 		PowersOfTwo(15)
> 		ctr+=1
> 		if time()-t>=1 then
> 			tt+=time()-t
> 			t=time()
> 		end if
> 		--task_yield()
> 	end while
> 	
> 	printf(1,"Without task_yield() - Counter= %d\n",ctr)
> 	printf(fn,"Without task_yield() - Counter= %d\n",ctr)		
> 	
> 	ctr=0
> 	tt=0
> 	t=time()
> 	while tt<10 do
> 		PowersOfTwo(15)
> 		ctr+=1
> 		if time()-t>=1 then
> 			tt+=time()-t
> 			t=time()
> 		end if
> 		task_yield()
> 	end while
> 	
> 	printf(1,"With task_yield() Counter= %d\n",ctr)
> 	printf(fn,"With task_yield() Counter= %d\n",ctr)		
> end for
> 
> puts(1, "Done\n")
> close(fn)
> </eucode>
{{{

> 
> The results were these:
> 
> --------------------------
> Program run as an .ex file
> --------------------------
> Without task_yield() - Counter= 8907
> With task_yield() Counter= 6990
> Without task_yield() - Counter= 12522
> With task_yield() Counter= 6990
> Without task_yield() - Counter= 12922
> With task_yield() Counter= 9974
> Without task_yield() - Counter= 18442
> With task_yield() Counter= 6926
> Without task_yield() - Counter= 13146
> With task_yield() Counter= 7006
> Without task_yield() - Counter= 18282
> With task_yield() Counter= 8606
> Without task_yield() - Counter= 18522
> With task_yield() Counter= 9822
> Without task_yield() - Counter= 13114
> With task_yield() Counter= 6942
> Without task_yield() - Counter= 12906
> With task_yield() Counter= 6998
> Without task_yield() - Counter= 12522
> With task_yield() Counter= 9790
> --------------------------
> Program run as an .exw file
> --------------------------
> Without task_yield() - Counter= 6506820
> With task_yield() Counter= 5603225
> Without task_yield() - Counter= 6627387
> With task_yield() Counter= 5908716
> Without task_yield() - Counter= 6681521
> With task_yield() Counter= 5955933
> Without task_yield() - Counter= 6763471
> With task_yield() Counter= 5927231
> Without task_yield() - Counter= 6704800
> With task_yield() Counter= 5944609
> Without task_yield() - Counter= 6680652
> With task_yield() Counter= 5874263
> Without task_yield() - Counter= 6798967
> With task_yield() Counter= 5994632
> Without task_yield() - Counter= 6796827
> With task_yield() Counter= 5920769
> Without task_yield() - Counter= 6732716
> With task_yield() Counter= 5992335
> Without task_yield() - Counter= 6808662
> With task_yield() Counter= 5996697
> ----------------
> 
> I was looking in to the task_yield() command to see what difference it made
> and trying to begin to understand how Windows deals with its tasks, i.e. how
> to get a program to "play nice".
> 
> The results are amazing in their difference in speed!  The .exw file ran
> around 500 times faster.  The proportional difference in the task_yield() 
> command is different too.

We found a while back that the time() function, which is also used
inside task_yield(), is much faster on Windows than on DOS.

> So, is this what you would have expected to have been the result?  Can I
> modify the properties of ex.exe to increase the speed?
> 
> Also, there was a quite different effect in Process Manager (similar to 
> Task Manager) as to the use of the CPU.  With ex.exe, the System Idle Process
> was around 94 to 98% all the time.  When exw.exe ran it took the place of
> System Idle Process and used nearly all the resources.  So, is that the
> normal way of things?  Any way to modify that -- "nice" it?  I ask because
> I do run some programs that slow to a crawl with exw.exe running (especially
> an old copy of MS Word when it saves a file).
> 
> Still learning about tasks...

I don't think this has much to do with tasks, other
than the fact that task_yield() makes one call to ask
the system for the time.

> ...
> So, just because it ran in a Full Screen mode, it is a whole bunch faster?

I know that Windows runs DOS programs in some strange emulation mode
that behaves differently depending on full-screen vs. 
window. I don't really understand it. Another oddity that I came
across was with the task_sort.ex demo. Run it, then start
sliding your mouse back and forth. When your mouse is moving,
the program runs much faster (and the program itself
makes no use of the mouse).

Regards,
   Rob Craig
   Rapid Deployment Software
   http://www.RapidEuphoria.com

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu