[fpc-devel] Why/how does the compiler have a non-trivial numberofmemory leaks after over two decades of development?

J. Gareth Moreton gareth at moreton-family.com
Mon Jul 30 19:01:01 CEST 2018


 Compilers are one of those programs that fall under a very special, very
exclusive set of projects where a lot of the standard rules may not apply,
but if they can be followed where possible, brilliant.
 Sometimes, increasing complexity and maintainability in the name of speed
is not a solution, as I found out with my binary search implementation. 
However, a way around that is to see if we can program such a feature into
the compiler itself if it detects it can gain a speed boost from it (in
this situation, a case block with 36 values to choose from, but where each
branch calls an identically-structured procedure... some of the values call
the same routine, but otherwise the routines have the same parameters and
return types).

 If you can find a way to fix a memory leak without sacrificing performance
too significantly, by all means submit a patch for review.
 If I had my way, if I wanted to make the compiler as fast as possible, I'd
just drop into assembly language for the most critical parts, but that's a
big no-no in this particular project, not because of how hard it is to
maintain, debug and explain, but because of cross compilation issues.  You
should be able to create a compiler that targets any platform of your
choice.  I think the only time you can use assembly language is with some
of the internal compiler routines like the Frac function.

 Gareth aka. Kit

 On Mon 30/07/18 17:42 , "Marcos Douglas B. Santos" md at delfire.net sent:
 On Mon, Jul 30, 2018 at 12:29 PM, R0b0t1  wrote: 
 > On Mon, Jul 30, 2018 at 7:32 AM, Martok  wrote: 
 >> Am 30.07.2018 um 14:24 schrieb Marcos Douglas B. Santos: 
 >>> Is performance more important than being correct? :| 
 >> In this project, the answer is always taken to be yes. 
 >> 
 > 
 > To hopefully offer some explanation for Mr. Santos - if I can compile 
 > and run the program 5 times over the course of 20 minutes, that is 
 > certainly better than running it and testing it once over the same 
 > amount of time, no? 
 > 
 > It might be hard to imagine FPC taking that much longer than it does 
 > currently but ~30min for a large program is the standard with other 
 > compilers. I very much enjoy the speed of FPC. 

 All us like fast compiling... 
 However, IMHO, a compiler should use the same good practices that 
 others programs must use. 
 If it cannot use them because it's very slow, what is the matter about 
 good practices? 

 "Do what I'm telling you to do, but don't do what I do" ? :) 

 best regards, 
 Marcos Douglas 
 _______________________________________________ 
 fpc-devel maillist - fpc-devel at lists.freepascal.org [3] 
 http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel
[4]">http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel 

 

Links:
------
[1] mailto:r030t1 at gmail.com
[2] mailto:listbox at martoks-place.de
[3] mailto:fpc-devel at lists.freepascal.org
[4] http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-devel/attachments/20180730/39a1832e/attachment.html>


More information about the fpc-devel mailing list