Thank you for the answers!

On Thu, Sep 8, 2016 at 3:31 AM, Dimitris Chloupis <kilon.al...@gmail.com>
wrote:

> It does not matter. When it comes to performance the workflow is always
> the same whatever the language you use.
>
> 1. Profile the code see where it consume most CPU cycles
> 2. Can you improve the code to remove unnecessary processing ? You will be
> surprised how many times its your code and not the language that is slow
> 3. If it's not your code can you find a library written in C that is
> optimized for speed ?
> 4. If no then write the code in C compile it as shared library and use it
> from the language of your choice using an FFI
>
> Basically when a VM in a dynamic language finds a call to a C shared
> library using the FFI it will freeze everything and give priority to the C
> code to execute the call to its native speed. Then after the execution the
> VM resumes. There is an overhead however for making the call.
>
> Because speed depends on the factors I described above for many
> experienced coders general benchmarks are completely useless.
>
> Speed in the end is just machine code with as less instructions as
> possible using most hardware acceleration as possible.
>
> Talking about hardware acceleration if you try to do the same processing
> on a list of data which is very large in parallel don't even consider C ,
> instead go directly to GPU because it can accelerate even up to 100 times
> compared to CPU. But in the end will depend on how much speed you really
> need. If you indeed need it then you can accelerate your code using the GPU
> with the help of CUDA or OpenCL.
>
> Remember however that optimizing is the root of true evil , it will make
> your code ugly, hard to read, difficult to extend and much more buggy.
>
> PS: the vast majority of benchmarks including the ones linked by Clement
> use just code written in the language tested also using the library that
> the language comes with. That means that they use none of the normal
> optimizations I described above and hence they cannot be considered
> practical realistic scenarios.
>
> On Thu, 8 Sep 2016 at 02:30, Vitor Medina Cruz <vitormc...@gmail.com>
> wrote:
>
>> Hello,
>>
>> How is Pharo compared with Ruby in terms of performance? Has someone done
>> some comparison benchmark? If yes, that was done with other platforms?
>>
>> Regards,
>> VItor
>>
>

Reply via email to