home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   comp.lang.forth      Forth programmers eat a lot of Bratwurst      117,927 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 116,747 of 117,927   
   Anton Ertl to Stephen Pelc   
   Re: Avoid treating the stack as an array   
   16 Sep 24 17:29:20   
   
   From: anton@mips.complang.tuwien.ac.at   
      
   Stephen Pelc  writes:   
   >On 15 Sep 2024 at 18:16:34 CEST, "Anton Ertl"  wrote:   
   >   
   >>> I can buy a lot of CPU cycles for the cost of one day of programmer   
   >>> time.   
   >>   
   >> Some guy called Stephen Pelc (must be a different one) recentlu posted   
   >> :   
   >>   
   >> |We (MPE) converted much of our TCP/IP stack not to use locals. This   
   >> |was mostly on ARM7 devices, but the figures for other 32 bit CPUs of   
   >> |the period (say 15 years ago) were similar. Code density improved by   
   >> |about 25% and performance by about 50%.   
   >>   
   >> How much time did that conversion cost?  And this Stephen Pelc   
   >> suggested that Buzz McCool (and probably everyone else) should also   
   >> spend their time on avoiding and eliminating locals from their code.   
   >>   
   >> I am with you here, not with the other Stephen Pelc: Programmers   
   >> should use locals liberally if it saves them time, even in the face of   
   >> slow locals implementations, because you can buy a lot of CPU cycles   
   >> for the additional programming cost of avoiding locals.   
   >   
   >What you ignore is that the constraints of embedded systems with small   
   >alow CPUs (by comparison with desktop CPUs) are very different from   
   >those of desktop CPUs. Converting the TCP/IP stack was driven by the   
   >client requirement to fit a TCP/IP app into 128k/256k Flash and 16k RAM.   
   >   
   >I would not make that trade off today.   
      
   Interesting.  So why mention it in    
   without adding that?  And why do you write "What you ignore is [...]"   
   if the situation has vanished.   
      
   In any case, if such a situation still exists or reappears, and/or   
   customers who want more performance or smaller code appear, it seems   
   to me that the better (more general, i.e., the ultimate evil in the   
   eyes of some) solution is a native-code compiler that tries to keep   
   all values in registers, whether from the data, return, or FP stack or   
   in locals, and tries to do that throughout the definition, not just in   
   a basic block.   
      
   I should have found the time to do that long ago, maybe some day I   
   will.   
      
   - anton   
   --   
   M. Anton Ertl  http://www.complang.tuwien.ac.at/anton/home.html   
   comp.lang.forth FAQs: http://www.complang.tuwien.ac.at/forth/faq/toc.html   
        New standard: https://forth-standard.org/   
      EuroForth 2024: https://euro.theforth.net   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca