#Problems For Benchmarking
14 messages · Page 1 of 1 (latest)
personally, shit like prime finders and any other very high cpu only loads are not good indicators when they are the only thing you're benchmarking
try to write benchmark code that involves more broad, real-world stuff like allocations and multithreading, maybe even async etc
python and rust will run about the same speed if you just do simple math (single threaded) but as soon as you start screwing around with allocating stuff on the heap, shit slows down to a crawl (this is esp. true in JS for example)
@eternal abyss I have 2 questions to you, to be able answer your question.
And I need you to answer the first question with as little thinking as possible.
And then take your time and think about it really well before you answer the second question.
- First question: (Answer quickly, even one word might be enough)
||What do you want to benchmark?|| - Second question: Really think about the answer!
||What do you want to benchmark?||
Programming languages?
I have mentioned that in my post
you can benchmar a lot of things about them, for example what is the least amount of characters, to write a program doing X.
Or you can measure which language have longest specification.
Or you can benchmark which language produces smallest binary to do Y, under default condition.
Or you can benchmark which language produces smallest binary to do Y, under most optimal conditions for given language.
Or you can benchmark compile time of program doing Z.
Or you can benchmark many aspects of runtime speeds.
....
You can even be trying to benchmark how beautiful the programs are in given languages, which is really subjective thing, but quite a few people done that. So how can we know what problems to recommend to you, if we do not know your metric.
Some (often functional) languages have many functions in standard library that allow writing very short code, with no loops, and that is by some considered the most beautiful way to write code. I even heard that "(F#)It is 50% better, just because fun is a keyword!".
So there are many subjective metric you can measure.
So I repeat my question again. What do you want to benchmark, what metric? And please if possible try to give both answers, the instant one, what first comes to your mind. And longer answer after thinking about it.
In that case, I think I will go with Compile time and generated binary
The compile time one is pretty annoying to measure, because preferably you'd have some isolated system do the compiling, a VM will usually not cut it (although i can be wrong) so you have to find consistent hardware.
Something that will take quite some time (but you can automate it) is you can try using a raspberry pi and compile some implementation of some (sorting)algorithm. Though you're gonna have to know every language you use well enough to do so 🙂
or if you want you can just boot some linux os or windows off a different drive if you don't care for an RPi (they are insanely hard to get nowadays)
then any interpreted language wins, because compile time will be 0?
"generated binary" do you mean size? if so interpreted languages will again end with 0, and win?