Results 1 to 3 of 3

Thread: B4J Primes Benchmark

  1. #1

    Thread Starter
    PowerPoster
    Join Date
    Feb 2006
    Posts
    22,958

    B4J Primes Benchmark

    B4J Primes Benchmark

    Algorithm #1

    B4J: 2.78
    Java: 3.07
    Java with the limit calculated before the loop (as in B4J): 2.91
    C#: 2.69

    Algorithm #2 - sieve

    The C# code was fixed to only return the count of primes without collecting the primes, and the maximum was set to 200M.
    B4J - same algorithm as the C# algorithm: 1.80
    Java: 1.90
    C#: 2.50


    What does it mean?

    The exact numbers aren't important. Small changes in the code can affect the results in unexpected ways due to the underlying compiler optimizations.

    It does show that B4J, Java and C# have similar core performance.
    Something to consider before touching the .Net tar baby. No need to get stuck.

  2. #2

  3. #3

    Thread Starter
    PowerPoster
    Join Date
    Feb 2006
    Posts
    22,958

    Re: B4J Primes Benchmark

    Well if that's a 3rd algorithm maybe somebody should try that too.

    But the point was that you can get comparable performance without moving to C# or directly to Java.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width