Re: Pakistan Earthquake - September 25, 2013
Posted by Skywise on September 28, 2013 at 16:25:24:

Perl is really and truly the wrong language for the job. It was never intended to be more than a simple scripting language. It's good at handling large databases and running websites, but not so good at doing computationally intensive tasks. But even on websites, it only runs the interface. The hard core crunching on the servers is done in other languages.

I understand why both Perl and TB are being CPU hogs, but I don't know how to explain it simply in less than a paragraph. There's just so much stuff going on behind the scenes in how your programs interact with the operating system. I probably don't need to say I don't have this issue in XBasic (unless I make an error).

But, the problem has to do with how both languages are interacting with the OS for user input such as waiting for keyboard input. In essence, they are trying to assert direct control over that process when in reality it should be released to the OS. The OS is pretending to play nice with your programs so they will work, but it ends up wasting CPU cycles.

For the stuff Roger does, TB is fine for those tasks. Even though it's relatively slow, it's still much faster than Perl. The program is done in a few minutes at most.

But EQF, you should really look to learning a different programming language. The learning curve may be frustrating at first and slow down progress, but once you start mastering the new stuff the rewards will be well worth the effort - faster results by orders of magnitude, and less CPU hogging. By trying to force Perl to do what you are doing is like trying to force a car to fly when you should use an airplane instead.

Brian


Follow Ups:
     ● Re: Pakistan Earthquake - September 25, 2013 - Roger Hunter  17:24:53 - 9/28/2013  (100928)  (1)
        ● Re: Pakistan Earthquake - September 25, 2013 - Skywise  18:39:25 - 9/28/2013  (100929)  (1)
           ● Re: Pakistan Earthquake - September 25, 2013 - Roger Hunter  19:00:13 - 9/28/2013  (100930)  (1)
              ● Re: Pakistan Earthquake - September 25, 2013 - Skywise  19:58:40 - 9/28/2013  (100931)  (1)
                 ● Re: Pakistan Earthquake - September 25, 2013 - EQF  22:06:31 - 9/29/2013  (100932)  (1)
                    ● Re: Pakistan Earthquake - September 25, 2013 - Skywise  00:28:00 - 10/1/2013  (100936)  (1)
                       ● Re: Pakistan Earthquake - September 25, 2013 - EQF  18:05:54 - 10/1/2013  (100945)  (1)
                          ● Re: Pakistan Earthquake - September 25, 2013 - Roger Hunter  18:50:16 - 10/1/2013  (100946)  (0)