home bbs files messages ]

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

   comp.lang.c      Meh, in C you gotta define EVERYTHING      243,242 messages   

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

   Message 242,212 of 243,242   
   David Brown to bart   
   Re: _BitInt(N)   
   28 Nov 25 21:58:04   
   
   From: david.brown@hesbynett.no   
      
   On 28/11/2025 20:46, bart wrote:   
   > On 28/11/2025 10:41, David Brown wrote:   
   >   
   >   
   >>   But for me, -O2 is generally the sweet spot.  I have no real   
   >> interest in using a compiler that doesn't do decent optimisation - if   
   >> I am happy with slow code, I'll use Python.   
   >>   
   >   
   > That's like saying that if you can't go at 100mph, you're happy to walk!   
   >   
   > There's no compromise at all?   
      
   My work is mainly on microcontrollers, where efficient code is critical   
   (x86 processors are good at running unoptimised code quickly,   
   microcontrollers are not).  And some of my work is programming on PC's,   
   where it is rarely important - it makes more sense to use a language   
   targeting faster development time than faster runtime.  (The bulk of the   
   time spent when running Python code is in libraries, OS calls, waiting   
   for disks, IO, networks, etc.)   
      
   I'm sure plenty of people have use for "medium speed" languages, but I   
   don't see it for what I do.   
      
   Actually, the same goes for travelling.  I'm happy to go out for a walk,   
   but if I am trying to get somewhere at a distance, I'll drive.  I've   
   never thought "what I really want here to go to the shops is a car with   
   a max speed of 30 mph".   
      
   >   
   > I've taken a task (decode JPEG) which uses the same algorithm across   
   > three languages, and applied it to the same input. These are the   
   > runtimes, expressed in relative MPH:   
   >   
   >                                   
   Â Â Â Â Â Â Â Â  Drive 1 mile:   
   >    gcc -O3  C       108   mph              
   Â Â Â Â Â Â Â Â  33s   
   >    gcc -O2  C       100   mph              
   Â Â Â Â Â Â Â Â  36s   
   >    mm       M        77   mph (my lang)             
   47s   
   >    bcc      C        55   mph (my product)     1m 05s   
   >    tcc      C        25   mph            
    Â Â Â Â Â Â Â  2m 24s   
   >    CPython  Python    0.8 mph              1h 15m 00s   
   >   
   > Actually, forget walking: you'd rather crawl on your hands on knees!   
   >   
   > (The figure for PyPy for this task, which has lots of long loops to get   
   > stuck into, is 19 mph, but the speedup is generally unpredictable.)   
   >   
   >   
      
   I don't write jpeg decoders on PC's.  I very rarely write code that has   
   to be fast on a PC.  (It has happened occasionally - but usually then I   
   use existing fast code like numpy to do the heavy lifting.)  On the few   
   occasions that I write C or C++ code on PC's, I use optimisation.  For   
   one thing, it gives better static error checking.  And while I probably   
   am not too bothered about the speed differences, it's just hard for me   
   to purposefully and pointlessly pessimise code.   
      
   --- 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