Results 1 to 6 of 6

Thread: ่java จะเร็วกว่า C++ จริงเหรอ

  1. #1
    Junior Member
    Join Date
    Nov 2006
    Posts
    27


    ๋่java จะเร็วกว่า C++ จริงเหรอ
    ผมไปดูผล การทดสอบมา พบว่ามันโอเวอร์เกินไป
    แต่ในหลายๆการทดสอบ java เร็วพอๆ กับ C++เลย
    แต่เท่าที่ผมศึกษามา่ C++ เขียนดีๆ ก็เร็วกว่า C ได้ โดยเ้ฉพาะใน compiler รุ่นใหม่ๆ
    อยากขอความคิดเห็นหน่อยครับ

    http://www.idiom.com/~zilla/Computer...benchmark.html
    http://www.idiom.com/~zilla/Computer...benchmark.html
    http://kano.net/javabench/
    http://www.weiqigao.com/blog/2004/09...912414000.html

  2. #2
    Administrator asylu3's Avatar
    Join Date
    Jun 2000
    Location
    Thailand
    Posts
    3,557


    คุยว่าภาษาไหนดีกว่าภาษาไหนนั้นไม่ต่างกับคุยเรื่องศาสนาเลย
    ควรจะมองที่ว่า การนำไปใช้งานนั้น เอาไปทำอะไรมากกว่า บางงานต้องการผลงาน แต่ไม่ Serious เรื่องเวลาในการพัฒนา
    ก็ควรมองหาภาษาที่พัฒนาได้ไวๆ ง่าย แต่หากมองเรื่องประสิทธิภาพในการทำงานเป็นหลักและความถูกต้องสูงก็คงไม่พ้นภาษาที่ Low level มากๆ เช่น C/C++ , Assembly ส่วนจะเลือกอันไหนนั้นก็ตามแต่ผู้นำไปใช้งานอีก
    อีกตัวอย่างนึงที่เห้นได้ใช้คือ การนำไปพัฒนาเกมส์ คงปฏิเสธไม่ได้ว่าเกมส์ดังๆ ส่วนมากก็ใช้ C/C++ เป็น Base ทั้งนั้น
    แม้แต่ในเครื่อง Console PSP, PS2-3, Wii, เองก็ตาม API เหล่านั้นก็มา C/C++ ทั้งนั้น
    แต่ก็มีไม่้น้อยที่เขียนด้วย Java แต่ไม่ว่าจะเขียนด้วยภาษาอะไร หากสามารถทำให้ผู้ใช้พอใจได้
    นั้นก็คือประสบความสำเร็จแล้ว

  3. #3


    มันเร็วกว่าอย่างมีเงื่อนไขครับ แต่อย่างว่านะแหละ จะใช้ภาษาอะไรต้องดูปัจจัยหลายอย่างครับ ออ อยู่ที่คนเขียนโปรแกรมด้วยครับ เคยเจอไม๊ โปรแกรมเดียวกัน ทำงานเหมือนกัน แต่คนแรกโปรแกรมใช้เวลา 8 ชั่วโมง อีก คนใช้เวลา 15 นาที โปรแกรมทำงานเรียบร้อย

    At first it was the JIT:

    When Java gets a JIT, it would be faster than C++.

    Then it was the HotSpot:

    When the HotSpot is done, Java would be faster than C++.

    Now it is the benchmarks:

    Professor So-and-so did a benchmark, and guess what, Java is faster than C++.

    And the well-argued theories:

    The garbage collector is faster than hand collection for the same amount of garbage.

    But my experience tells me that Java is slower than C++:

    * My Java based "Hello, World." program is slower than my C++ "Hello, World." program.
    * My Java based Java compiler is slower than my C++ based Java compiler.
    * My Java based IDE (wonderful as it is) is slower than my C++ based IDE.
    * My Java based JavaScript interpreter is slower than my C++ based JavaScript interpreter.

    Java has many advantages over C++. Performance is not one of them.

    The good news is that the Moore's Law and cheaper memories has done a lot more to boost Java's performance than anything else. Java is the appropriate technology in more and more applications.[/b]

  4. #4
    Junior Member
    Join Date
    Oct 2007
    Posts
    3


    ผมเคยอ่านเจอที่ในหนังสือสักเล่มว่าภาษา C เร็วกว่า Java ประมาณ 10 เท่า

    ทั้งๆที่หนังสือเล่มนั้นเป็นหนงสือสอน Java นะ

    ปล.ผมอ่านเจอนะครับอย่าด่าผ้ม

  5. #5
    Junior Member
    Join Date
    Aug 2008
    Posts
    1


    ผมว่าC++เร็วว่าjavaนะครับ
    เพราะ C++เมื่อcompileแล้วได้เป็น binaryเลย(.exe)แต่javaเป็น.classต้องใช้interpreterในการรัน
    หากผิดพลาดประการใดผมต้องขออภัยมา ณ ที่นี้ด้วย

  6. #6
    Junior Member
    Join Date
    Jul 2008
    Posts
    8


    ถ้าพูดกันจริงๆ แล้ว ภาษา C จะเป็นภาษาที่ระดับมันออกจะต่ำกว่า
    Java อยู่เยอะ ครับ นั้นหมายความว่า ภาษา C จะถูกแปลงเป็นภาษา
    เครื่องได้เร็วกว่า ภาษา Java ทำให้ คอม เข้าใจได้ง่ายกว่า อีกทั้ง Java
    ทำงานบน ระบบเสมือนของมัน ก็ยิ่งต้องแปลงกันมากขึ้น
    มันจึงน่าจะทำงาน ช้ากว่า ภาษา C

Similar Threads

  1. ทุกข์ จริงเหรอ
    By KhunakornX in forum ธรรมะ พุทธศาสนา
    Replies: 0
    Last Post: 28-02-2009, 03:40 PM
  2. Replies: 3
    Last Post: 17-09-2007, 02:58 PM
  3. Replies: 0
    Last Post: 03-09-2007, 12:54 PM

Members who have read this thread : 0

Actions : (View-Readers)

There are no names to display.

Tags for this Thread

Posting Permissions

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