mersenneforum.org  

Go Back   mersenneforum.org > Factoring Projects > GMP-ECM

Reply
 
Thread Tools
Old 2017-11-05, 17:08   #12
xilman
Bamboozled!
 
xilman's Avatar
 
"π’‰Ίπ’ŒŒπ’‡·π’†·π’€­"
May 2003
Down not across

29·3·7 Posts
Default

Quote:
Originally Posted by Brian Gladman View Post
The downside of static linking is that GMP-ECM has to be built for specific CPUs/GPUs if full optimisation is to be provided.
The zero-th law of optimization: first get it right, then get it fast.

For those who care about subsequent optimization steps, I'm sure that there a number of people here who will assist you.
xilman is offline   Reply With Quote
Old 2017-11-06, 05:58   #13
LaurV
Romulan Interpreter
 
LaurV's Avatar
 
Jun 2011
Thailand

226128 Posts
Default

Quote:
Originally Posted by xilman View Post
The zero-th law of optimization: first get it right, then get it fast.
That is incomplete.
The zero-th law of optimization: first get it right, then get it fast, then get it right again.
Or even:
The zero-th law of optimization: first get it right, then get it fast, then repeat

In my daily job I met hundreds of situations where the firmware didn't behave as expected after optimizations were done (I mean both turning on/off different levels of optimizations in the compiler and also hand-made optimizations, i.e. changes in the code, but especially playing with the compiler's optimizer... we preffer to use -o0 due to better step-debugging features, then switch to -o1, -o2, etc, space, time, optimizations, as the MCU memory gets full, or things get slower, and in these cases we witnessed many situations in which the code didn't work as expected after the compiler did its tricks, especially things related to timers, interrupts, signals synchronization, pwm, etc).
LaurV is offline   Reply With Quote
Old 2017-11-06, 06:25   #14
paulunderwood
 
paulunderwood's Avatar
 
Sep 2002
Database er0rr

3,739 Posts
Default

Quote:
The real problem is that programmers have spent far too much time worrying about efficiency in the wrong places and at the wrong times; premature optimization is the root of all evil (or at least most of it) in programming.
Source
paulunderwood is offline   Reply With Quote
Old 2017-11-06, 07:34   #15
xilman
Bamboozled!
 
xilman's Avatar
 
"π’‰Ίπ’ŒŒπ’‡·π’†·π’€­"
May 2003
Down not across

101010000000002 Posts
Default

Quote:
Originally Posted by LaurV View Post
That is incomplete.
The zero-th law of optimization: first get it right, then get it fast, then repeat
I'll stick with my version. What you are describing, in my view, is not the zeroth law but the overall process of optimization.

The first and second laws, as I know them are:

1) Don't do it.
2) Don't do it now.


I'll leave you to think about what they mean in terms of specific optimization techniques.
xilman is offline   Reply With Quote
Old 2017-11-06, 09:14   #16
Brian Gladman
 
Brian Gladman's Avatar
 
May 2008
Worcester, United Kingdom

10000101002 Posts
Default

Quote:
Originally Posted by xilman View Post
The zero-th law of optimization: first get it right, then get it fast.

For those who care about subsequent optimization steps, I'm sure that there a number of people here who will assist you.
In this case it is not an optimisation issue for the GMP-ECM code but simply that of choosing an MPIR library to link to it that has been built with assembler code support for the target machine in question.

As of now there are 20 different machine architectures for x64 versions of MPIR and hence up to this number of GMP-ECM binaries, which is a lot to manage.

Since most DLL issues are the result of missing MS library DLLs, I had hoped to avoid these by providing a statically linked GMP-ECM and a statically linked MPIR DLL so that the the only dynamic link involved would be between GMP-ECM and MPIR. This almost works but fails for some reason when MPIR code involves file input/output.

Anyway for those brave enough to do their own builds, I have now uploaded my Visual Studio 2017 build files (with static linking) to the GMP-ECM repository.
Brian Gladman is offline   Reply With Quote
Old 2017-11-06, 16:44   #17
jwaltos
 
jwaltos's Avatar
 
Apr 2012
Brady

18016 Posts
Default

As one of the end users who has downloaded your binaries from Jeff G.'s site, thanks for providing your work. I personally do not require optimized programs since what has been provided was more than sufficient for generic factorization.

Regarding optimization, here is a quote from Jon Bentley's "Programming Pearls" on p.88:
"Don Knuth has observed that premature optimization is the root of much programming evil;..."

Successful technological alchemy requires efficiency..and wizardry.

Last fiddled with by jwaltos on 2017-11-06 at 16:47 Reason: added LOTR allegory
jwaltos is offline   Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Visual Studio 2015 build Brian Gladman Msieve 3 2016-10-04 10:40
GMP-ECM with Visual Studio 2015 Brian Gladman GMP-ECM 0 2016-09-29 11:33
Visual Studio (yech) R.D. Silverman Programming 12 2015-09-07 00:54
Using YAFU in Visual Studio queremendi YAFU 12 2015-07-09 15:40
AMD64 Applications with Visual Studio 6 or .Net Ethan (EO) Software 0 2004-08-09 04:07

All times are UTC. The time now is 11:54.


Fri Jul 16 11:54:15 UTC 2021 up 49 days, 9:41, 2 users, load averages: 1.61, 2.51, 2.15

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2021, Jelsoft Enterprises Ltd.

This forum has received and complied with 0 (zero) government requests for information.

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation.
A copy of the license is included in the FAQ.