this post was submitted on 28 Oct 2023
107 points (95.7% liked)

Programmer Humor

32050 readers
1545 users here now

Post funny things about programming here! (Or just rant about your favourite programming language.)

Rules:

founded 5 years ago
MODERATORS
 

2020 study pdf.

After seeing this a couple years ago I started to be more responsible for my PHP code, writing it even with the slightest micro-optimizations possible, since more times people use my code (especially due to nature of PHP being executed in every http request), more energicity they waste because of my lazyness and more they pollute the planet. JIT was NOT included in this experiment, so the number can be much more lower.

I hope you will be responsible for your code so on too (generally I mean people using interpreted languages).

you are viewing a single comment's thread
view the rest of the comments
[โ€“] [email protected] 16 points 10 months ago (1 children)

Why is there such a large jump from TS to JS?

[โ€“] [email protected] 10 points 10 months ago* (last edited 10 months ago)

good question, probably the transpiled code does not match the optimized js. Maybe, if they targeted the same js version as js version they are benchmarking, the results would be equivalent?

Also, if they are using a node version with ts support, it will compile the ts before execution which means they are measuring the impact of the compiler, which can be a lot for small snippets.