Announcement

Collapse
No announcement yet.

Tumblr Is The Latest Company Boasting About PHP7 Performance

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • #11
    Originally posted by yzsolt View Post
    Are people really use PHP for any serious project in 2016?
    Perhaps you've heard of the internet? You might want to check that out.
    I'm glad you really like whatever alternative you didn't bother elaborating on.
    Oh, I see you did mention native development, so show us that html code you've moved on to.

    Comment


    • #12
      Originally posted by AsuMagic View Post
      And maybe Java will reach the performance level of C++ by... no, nevermind
      Are you from the past? Java is faster than C++ in several cases. In the remaining ones is as fast as C++.

      Comment


      • #13
        Originally posted by cynic View Post

        Are you from the past? Java is faster than C++ in several cases. In the remaining ones is as fast as C++.
        I think that's why he said "no, nevermind".... Love Java Hate

        Comment


        • #14
          I'm trying to manage an internal server by apache to make PHP projects by Netbeans but in vain, in fact I always get 404 page error apache2 server lacks the php project. I've downloaded alla the package necessary (so called LAMPP). ON windows systems by virtual box I manage it through freeBSD adding webmin and easyPHP on windws. So what is the cause of the mistake? thanks

          Comment


          • #15
            Originally posted by cynic View Post

            Are you from the past? Java is faster than C++ in several cases. In the remaining ones is as fast as C++.
            Java is completely destroyed by C/++ in terms of performance.

            Comment


            • #16
              Originally posted by boxie View Post

              You do realise not every language has to implement every language feature ever, right?
              Sure, but it makes the language feel ancient and less expressive. You get limited in the things you can do, or have to solve things in weird backward ways and using hacks or more boilerplate code.

              Comment


              • #17
                beside the fact that you don't even realize that C and C++ are completely different languages (and that benchmarks are about C) those are microbenchmarks that are completely useless for real world performance measurement.

                Comment


                • #18
                  Originally posted by cynic View Post

                  beside the fact that you don't even realize that C and C++ are completely different languages (and that benchmarks are about C) those are microbenchmarks that are completely useless for real world performance measurement.
                  C and C++ are pretty comparable performance wise.. as C++ code can be translated to C code easily.. The whole object concept is just a design concept and not relevant to code execution.. In the end you will have pointers pointing to structured data in memory, for C as for C++.

                  C / C++ programs will always smoke Java performance wise easily, if (and thats a big if) they are written correctly... Which is much harder than in Java / C# or any other environment which runs on a VM later on.

                  In my experience, Java / C# Devs tend to ignore / don´t understand the computational complexity of operations they perform inside their code. However the main factor of performance differences is the way you instruct a machine to solve your problem and how well it´s suits the underlying machine architecture / how good you adapt the problem to the machine architecture.

                  Example: Java devs tend to use ArrayList (chained List) or HashMaps out of convenience, even if the know the number of elements in advance. However this leads to a lot of random memory lookups and lot of copying arround while filling that list / accessing it -> Bad performance.. Simple rule:
                  - allocate memory in advance for the task you are going to perform
                  - process as linearly as possible to make maximum use of CPU caches and avoid bad branch prediction / avoid accessing far away memory addresses

                  Excessive use of Reflection and dynamic typing / anonymous functions:
                  There are constructs in languages like java / c# which require the VM to JIT compile a version of the construct for every time it´s called, as the input type is dynamic for example.. This is a extrem performance killer an can be avoided easily most of the time, but out of convenience many people use it.

                  Java devs IMHO tend to waste a lot of memory, as they load a shitload of libs and don´t care about the memory requirements of the structures they use. Having multiple gigs of memory allocated to your java app furthermore makes the garbage collection really slow, as it has to dig through all that memory to free unreferenced instances.. On the other hand it´s easy to create a memory leaks in C / C++ if you are not carefull.

                  In the end: Java / C# makes your life a lot easier as you don´t have to care about a lot of details, but you have to sacrifise performance!

                  Comment


                  • #19
                    Originally posted by Spacefish View Post
                    C and C++ are pretty comparable performance wise.. as C++ code can be translated to C code easily.. The whole object concept is just a design concept and not relevant to code execution.. In the end you will have pointers pointing to structured data in memory, for C as for C++.
                    [...]
                    How do you think Java or C# work? In the end everything just uses raw memory and CPU instructions.
                    There were even Java to C compilers in the beginning, by your logic Java was as fast as C because one could translate one to another, right?

                    Comment


                    • #20
                      Originally posted by Spacefish View Post

                      C and C++ are pretty comparable performance wise
                      We can even quote Stroustrup(http://www.informit.com/articles/art...px?p=2080042):

                      Danny: At least some of your readers are newcomers who haven’t programmed in C++ before. What is your advice for learning C++ from scratch? I bet you wouldn’t recommend that they learn C first before learning C++, as some experts used to suggest...

                      Bjarne: I have doubts about the areas of expertise of people who would still suggest the “C first” approach to C++. My textbook, Programming: Principles and Practice using C++ (PPP), is an extensive demonstration of my ideas of how to teach programming and C++ to novices. It has also been used for medium-level programmers and even industrially for experienced programmers coming to C++ from significantly different languages.

                      Basically, C is not the best subset of C++ to learn first. The “C first” approach forces students to focus on workarounds to compensate for weaknesses and a basic level of language that is too low for much programming. Consider a trivial function to compose an email address:

                      Code:
                      string compose(const string& name, const string& domain)
                      {
                      return name+’@’+domain;
                      }
                      Which can be used like this

                      Code:
                      string addr = compose(“bs”,”cs.tamu.edu”);
                      The C version requires explicit manipulation of characters

                      Code:
                      char* compose(const char* name, const char* domain)
                      {
                      char* res = calloc(strlen(name)+strlen(domain)+2); // space for strings, ‘@’, and 0
                      char* p = strcpy(name,res);
                      *p = ‘@’;
                      strcpy(domain,p+1);
                      return res;
                      }
                      Which can be used like this

                      Code:
                      char* addr = compose(“bs”,"cs.tamu.edu”);
                      // ...
                      free(addr); // release memory when done
                      Which version would you rather teach? Which version is easier to use? Did I really get the C version right? Are you sure? Why?

                      Finally, which version is likely to be the most efficient? Yes, the C++ version because it does not have to count the argument characters and does not have to use the free store (dynamic memory) for short argument strings.

                      This is not an odd isolated example. I consider it typical. So why do so many teachers insist on the “C first” approach? I suspect that it is mainly because that’s what they have done for decades.

                      Comment

                      Working...
                      X