Which programming language or compiler is faster
programming-language-benchmarks.vercel.app
programming-language-benchmarks.vercel.app
(Ok it’s 5-10k lines rather than a million, but it’s non-trivial enough that the differences between languages are noticable)
A common way to speed things up even more is to merge some cpp file together, so each compiler thread is active for longer and common headers are compiled once.
With the new module feature of C++20, compilation is transformed into a DAG, and it is still unclear if it's really faster than just throwing a lot of cores at the problem.
Also, here's a video of my edit-compile-run cycle ; cloc on that project gives me 506963 loc without counting dependencies. The software uses boost and fairly modern C++ with no particular feature restriction and templates going wild. It's not instant, but still, 2 seconds is somewhat tolerable (and definitely faster than various web stuff I've been involved with)
https://www.youtube.com/watch?v=lBSpv94FDE4
And then here is a claim that latest one (Delphi 11 Alexandria) is even faster:
http://www.danieleteti.it/post/delphi-11-alexandria-compiler...
I don't have Delphi 11, yet, so I can't verify their claim, but 10.4.2, which I have, is noticeable faster than previous versions I have scattered around in my virtual machines.
why would I ? I never have to do that during my dev cycle, that's not something really worth optimizing for. The whole build is ~4/5 minutes on that machine.
Also the link I gave you for video, that's a full rebuild. The guy does a cleanup first, getting rid of existing builded components/modules and then does a full rebuild.
This uses the debian language benchmarks, in search of what it was that was different I falsely concluded this must be about compilation speed.
http://shootout.alioth.debian.org
and it crashed and data was lost AFAR.
There's now
https://benchmarksgame-team.pages.debian.net/benchmarksgame/...
https://en.wikipedia.org/wiki/The_Computer_Language_Benchmar...
Just wanted to mention prior art.
The same benchmarks game project moved to new hosting at:
https://benchmarksgame-team.pages.debian.net/benchmarksgame/...
The deal breaker for me is that its compiler is JIT based whether you want it or not. Code will hang at runtime for multiple minutes as it compiles all the library dependencies and specializes them to the given data types.
I think the problems were from:
1) llvm itself getting dramatically slower over time, before more focus upstream on compiler speed more recently: https://www.npopov.com/2020/05/10/Make-LLVM-fast-again.html
2) different types of invalidations
3) less than ideal precompilation of packages
I think all of it has been improved, and can certainly be improved further. That also includes improving the speed of its interpreter (vs the JIT), which exists but was never optimized for speed afaik.
Also, there's a solution to precompile binaries with no JIT penalty...
https://github.com/JuliaLang/PackageCompiler.jl
Enjoy!
- immature web/network services stack. For better or worse the lang seemed to focus on more number crunching throughput early than reliable distributed data processing, but the latter is a much larger market and what most enterprises care about.
It's the difference between a lang only having Matlab or R ceiling vs python-like ceiling.
- poor static compilation or static analysis story. this is what a lot of people needing to put code in production need.
It's also standard expectation now with a lot of dynamic language code (python or js) that aims to be in production.
- for certain types of realtime uses, more direct control of memory is doable, but you have to jump through hoops. Again, determinism is very important.
- historically, compile times were quite horrid. part of this was llvm, part of it was julia. It's gotten way better in 1.6 and 1.7, but compilation results need to be cached more than just precompilation.
however, all being said, I love the lang! There is a lot going for it especially how the package ecosystem works. There is also a lot of innovative projects.
You're comparing it with python.
https://github.com/typeddjango/awesome-python-typing
https://github.com/ethanhs/python-typecheckers
though i'd say they are worse than similar tooling in typescript/javascript.
julia's tooling is relatively nascent.
I think there have been steps recently to make those optional recently. Julia was really optimized for "big iron"-styles of workloads, but that's less than ideal when you are not trying to just do linear algebra all day.
Nowadays, the language is promoted as a general purpose language suitable for any task or domain.
However, the perception that Julia is primarily for scientific computing remains strong among many developers. Only time will tell if that perception changes.
I don't use Unison but I would love to for this reason.
Incremental: 700ms
Esbuild clean: 100ms
The benchmarks are mixed with some having simd and some using threads. It'd be helpful to be able to sort submissions by threaded/unthreaded as well.
Still kinda fun to read the different languages. I found Zig was very chatty and annoying to read even compared to the C versions. The common lisp was foreign. The Fortran 90 with openmp and Julia versions were pleasant to read. The Nim version was easy to read but lacks threading or simd.
(Some languages with bad semantics for that might still get fast, but the language itself isn't designed to help that. JS for example was made fast, but with tons of effort but with tons of money and man-centuries thrown in by Google, Apple, Mozilla, MS, not the kind of recources available to most languages. So, I'd call a language whose semantics afford optimization a fast language).
Runtime complexity (e.g. "zero overhead" vs "lotsa overhead" features).
Also, I find the "language vs compiler" dicthotomy pedantic and tedious. For most languages and most use cases, there's a single dominant canonical version, e.g. CPython, Matz's Ruby, Oracle's Java.
Just because there are niche other implementations all 10 people use doesn't change the fact that 90% of users will be on the canonical implementation, and for them, THAT's synonymous with the language, not just some abstract spec.
Matz's Ruby MRI?
No — "Since Ruby 2.6 introduced MJIT in 2018, its performance greatly improved"
https://www.ruby-lang.org/en/news/2021/11/09/ruby-3-1-0-prev...
There's nothing stopping anyone from writing a fully standards compliant C interpreter that will have considerably slower process execution after all. In fact, a quick search shows that it's been done many times, for example this[1].
"How many times slower, the fastest benchmark programs for selected programming language implementations are, compared to the fastest written in any of the programming languages."
https://benchmarksgame-team.pages.debian.net/benchmarksgame/...
It's about time someone did. Thank you and nice work!
Meanwhile —
https://benchmarksgame-team.pages.debian.net/benchmarksgame/...
Don't you have the opportunity to compare user time as-well-as wall clock time?
( The benchmarks game does provide that sort --https://benchmarksgame-team.pages.debian.net/benchmarksgame/... )
Add compile time processing which can get pretty far into reducing all kinds of otherwise runtime ops...
https://stackoverflow.com/questions/2513741/c-vs-c-for-perfo...
from which I gather that if you're using an allocator function that zero's out memory then it will be slower of course.
Then you have various optimizations that come from things like templates, constexpr. Look at the qsort method - to have a modicum of genericity you need to pass a function that will be invoked. Instead, a C++ version would be able to be optimized to compare the elements directly, without calling a function, avoiding a big number of function calls.
There's no way to make C faster than well written C++. But C++ is complex and a lot of people write bad C++, that's why it has developed a bad reputation. It's really undeserved.
In theory `restrict` (to disallow pointer aliasing like in Fortran) could lead to optimization gains, same as not having exceptions (the possibility of exceptions prohibits certain optimizations of the C++ compiler).
https://github.com/hanabi1224/Programming-Language-Benchmark...
https://github.com/hanabi1224/Programming-Language-Benchmark...
The hardest part of learning a second and third programming language is overcoming your own frustration. Yes there are some pretty gnarly concepts in languages like Haskell. However, most mainstream programming languages are very similar to each other.
It is supposed to work with FreePascal: https://wiki.freepascal.org/AVR_Programming