Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Author of the failed trig experiment here.

After looking at the comments from people more knowledgeable than me, I realized that it had failed mostly because the assembly that I wrote was pretty bad. You have to know assembly language pretty well to beat the compiler.

I have been spending more time with this. And I understand my faults a bit better now. There are a lot of places which can be improved. And I have sent a CL to add some commands to the Go assembler (so that I don't have to write the ugly hex codes :P)

I plan to revisit the code once the CL is merged. And see how it goes.

To answer your question - You might get benefits if:

* You really understand what the compiler is doing.

* You know the current shortcomings of the Go assembler and the latest amd64 instruction set.

* You know assembly language well enough to write custom code for your problem and beat the compiler.

From what I have seen - the Go assembler attempts to generate binary code which supports old amd64 processors too. As a result of which you cannot take advantage of the latest instructions which come as part of AVX2 extensions. If you are doing high performance math stuff and know the AVX2 instruction set like the back of your hand, then you are sure to reap benefits.

Cheers.



Consider applying for YC's Winter 2026 batch! Applications are open till Nov 10

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: