Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Mdot science
Message
From
16/06/2021 14:41:44
Mike Yearwood
Toronto, Ontario, Canada
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Mdot science
Miscellaneous
Thread ID:
01681249
Message ID:
01681249
Views:
94
I am totally convinced the average programmer knows little about science. It is not taught the way medical professionals are taught science. Having worked with actual world-renowned medical science professors that were department heads, I got a lot of on the job training to use science while coding.

Donald Knuth is a hero to some idiots quoting his over-used-misunderstood Optimization is the root of all evil. How many of you read the entire article - and understood it?

https://pic.plover.com/knuth-GOTO.pdf

He also called out crappy coders:

"The conventional wisdom shared by many of today's software engineers (ya like there are a lot of those) calls for ignoring efficiency in the small; but I believe this is simply an overreaction to the abuses they see being practiced by penny-wise-and-pound-foolish programmers, who can't debug or maintain their "optimized" programs." That sounds all too familiar from what I've seen.

He goes on "In established engineering disciplines a 12% improvement EASILY OBTAINED, is never considered marginal (except by crappy coders); and I believe the same viewpoint should prevail in software engineering."

I am not penny-wise-pound-foolish. I make code faster, cleaner and better every time.

Refer back to Knuth - a 12% increase easily obtained is never considered marginal.

Using the following code in VFP9 I got a 227% increase simply using mdot with a cursor in place. That is scientific measurement. It is required to magnify the sample to get results. That is scientific. It is fact. The look of the code with or without mdot is IRRELEVANT except to the most immature.

So, Knuth supports a 12%. I'm certain a 227% would be a big deal, especially adding the safety factor.

The reason for science is to prevent a bunch of morons from attacking things to the betterment of all. Everytime I post anything about mdot, and for that matter anything at all a particular bully attacks what I say. Too bad the blocking feature here does not make such bullies completely invisible. The bullies and their supporters can go pound sand.
clear
use in select("c_mdot")
set decimals to 15

g=10000000
lcString="create cursor c_Mdot ("
a1=seconds()
for x = 1 to g
	c=x
endfor x
a1=seconds()-a1
?"no mdot",a1

lcString="create cursor c_Mdot ("
a2=seconds()
for x = 1 to g
	c=m.x
endfor x
a2=seconds()-a2
?"mdot",a2
x=a1-a2
?"10,000,000 loop no cursor",(x/a2)*100

g=254
a1=seconds()
x=1
lcString="create cursor c_Mdot (c"+alltrim(str(x))+" char (1)"
for x = 2 to g
	lcString=lcString+",c"+alltrim(str(x))+" char (1)"
endfor x
lcString=lcString+")"
a1=seconds()-a1
?"string no mdot",a1

a2=seconds()
x=1
lcString="create cursor c_Mdot (c"+alltrim(str(m.x))+" char (1)"
for x = 2 to g
	lcString=m.lcString+",c"+alltrim(str(m.x))+" char (1)"
endfor x
lcString=m.lcString+")"
a2=seconds()-m.a2
?"string mdot",m.a2

x=a1-a2
?"string",(x/a2)*100

&lcString
?"Created cursor."
g=10000000
a1=seconds()
for x = 1 to g
	c=x
endfor x
a1=seconds()-a1
?"no mdot",m.a1

a2=seconds()
for x = 1 to g
	c=m.x
endfor x
a2=seconds()-a2
?"mdot",m.a2

x=a1-a2
?"loop with cursor",(x/a2)*100

set decimals to 2
Next
Reply
Map
View

Click here to load this message in the networking platform