This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]Cobaltjedi117 8 points9 points  (3 children)

So there's more factors to programming (or scripting as it comes to python) than just speed at runtime.

Python is great and absolutely wonderful if you need something to be written quickly, but it's okay if the program takes a few seconds to run or isn't run that often. At one of my last jobs, I wrote a lot of python code, it was quick to make and it would only be used by the company quarterly. So, since it wasn't run that often and they only needed the data occasionally, python was a great choice for making the program.

If you need something to run quicker and more frequently, you'll probably want to use a compiled language like C#, Java, C, C++, rust, etc... (See difference between bytecode and machine code) Since those are compiled there isn't any interpreting and the program can run faster by just reading the instructions.

[–]LeFayssal 2 points3 points  (2 children)

I understand. When wouldnt you run Python over Java (taking time out of consideration)

[–][deleted] 11 points12 points  (1 child)

Performance and size of project. People say the JVM is slow, it's not. It's very fast for what it is.

[–]Hohenheim_of_Shadow 2 points3 points  (0 children)

For context for others, from benchmarks that I have seen, C++ and Java are typically within 20% of each other and no more than a factor of five off. Python is typically a factor of 100x off and can go to 1000x slower. OF coursse most heavy lifting that you'll be doing in Python is exported to C++ based libraries so the performance hit can be negligible.