HN user

fear91

547 karma
Posts6
Comments144
View on HN

Why not finance a more wide tax break for tech companies, including small companies?

I have seen first hand, one of my classmates from high-school, whom I didn't consider to be too bright, receive a 100k EUR grant to build an esports platform that ended up being a styled-up wordpress blog. He had zero interest in tech, never programmed, the works...

He had no interest nor knowledge relating to tech, but managed to somehow get that grant. Meanwhile, I was paying taxes on hard earned freelancing dev money. We were both 23 years old at the time and it was really jarring.

I'd rather they cut taxes for already profitable small companies. The taxes in EU are astronomic.

A rare game where having worse PC actually made you perform better. It was easier to time the jump perfectly. I recall starting 5 instances of it to slow it down as a kid and beating records. Fun times.

It's an example of how trivial some of this low hanging fruit is, the above is a concrete case that I have personally implemented (arithmetic of in-register 64/32-bit integers). You can get into semantics and restrictions, but I think the point I'm raising is clear.

This is an assumption that a reasonable person naively comes up with.

Then if you actually go ahead and check, it turns out it's not true! It's quite a shocking revelation.

When you dig into the popular compilers/runtimes (with the exception of things like LLVM)

Many of them still have low hanging fruit of the form:

a = b + c - b

Yes, the above is still not fully optimized in the official implementations of some popular programming languages.

Also an optimization of "removing redundant function calls" isn't a binary on/off switch. You can do it better or worse. Sometimes you can remove them, sometimes not. If you improve your analysis, you can do more of that and improve performance. Same for DSE, CSE, etc...

The nice thing about compiler optimizations is that you can improve performance of existing CPU's without physically touching them. Year by year. You squeeze more of the machine someone designed. It adds up.

Imagine what environmental impact you would have if you optimized Python's performance by 1%? How much CO2 are you removing from the atmosphere? It's likely to overshadow the environmental footprint of you, your family and all your friends combined. Hell, maybe it's the entire city you live in. All because someone spent time implementing a few bitwise tricks.

You can shrink it further by doing xorl reg, reg. On x86, the upper 32 bits are cleared for you when using 32 bit opcodes. No need to do a 64-bit reg, reg xor.

Instead of doing cmp $0, %eax, you can use test eax, eax - that's another low hanging fruit.

It seems that you could also preset a dedicated reg to 0 and another to 1, further shaving a few bytes.

There doesn't seem to be a good in-depth academic resource for advanced compiler optimization. I've searched a lot and all the courses I found were introductory, the actual interesting techniques require diving deep into the source code of popular OSS compilers. I found that quite surprising.

This might sound harsh, but:

Maybe the wise choice is to change the path? That feeling of resignation, while a bitter pill to swallow, might be a good thing in the end. I used to beat myself over for not working hard and dedicating myself to my ideas, yet a few years down the line it became obvious the startups I wanted to build would have been made obsolete by other tech. I've dodged a few wasted years, a burnout or straight-up insanity right there. Trust your gut.

Why do something you are not enjoying? Life is short, it might end faster than you think. The people close to you can also disappear sooner than you think. Try to make the most of it. It's not all about making it big and being successful/rich.

ChatGPT 4:

Ten elephants would have a total of 32 legs if two of them are legless.

Analysis:

# Calculating the total number of legs for ten elephants, considering two of them are legless

# Number of legs each elephant normally has legs_per_elephant = 4

# Total number of elephants total_elephants = 10

# Number of legless elephants legless_elephants = 2

# Total number of legs # (Total elephants - Legless elephants) * Legs per elephant total_legs = (total_elephants - legless_elephants) * legs_per_elephant total_legs

What are they using to benchmark single-threaded performance? I don't think it's good to state that without clarifying what is the task being run. You could have a benchmark that increments a number in register. Since add/increment runs in a single clock, a high frequency CPU (Pentium 4 at 3.8Ghz?) would win over a wide core with great memory bandwidth (M2 at 3.7Ghz). Technically, that's a greater single thread performance, but not really applicable to the real world.

If it's over a variety of tasks and/or in a task that's similar to real world computation, kudos to them!

It's a very useful instruction. Go uses it extensively in its core runtime and the compiler itself. I assume other languages do too if they care about performance.

Examples:

1. Growing a slice.

2. Runtime's heap bitmap.

3. Page allocation.

4. malloc.

5. Register allocation.