News for hackers. Stuff that matters.
Re:Golang PGO builds using GitHub Actions by ori_b on Wednesday April 24, 2024 @05:18AM (#40142229)
Why a flag? In what case would you turn that analysis off separately from other optimizations?
Re:Golang PGO builds using GitHub Actions by diegobernardes on Wednesday April 24, 2024 @06:47AM (#40142783)
Go is known by the speed of it's compiler, doing extra work during the compilation would slow it down. I would not mind either to have a "release" flag that would take minutes and produce a more optimized binary.
Re:Golang PGO builds using GitHub Actions by eliben on Wednesday April 24, 2024 @08:09AM (#40143410)
In a way, that's what the PGO mode of the compiler is
Re:Golang PGO builds using GitHub Actions by pjmlp on Wednesday April 24, 2024 @07:19AM (#40142989)
In theory that is what gccgo is for, in practice it is stuck in Go 1.18.
Re:Golang PGO builds using GitHub Actions by nasretdinov on Wednesday April 24, 2024 @02:41PM (#40148015)
tinygo also tries really hard to produce an optimised binary, however it mostly optimises for size, not speed.
Re:Golang PGO builds using GitHub Actions by KingOfCoders on Wednesday April 24, 2024 @10:26AM (#40144772)
Yes this, I mainly use Go for it's simplicity and the speed of the compiler. What I don't want is Rust compile speeds.
Re:Golang PGO builds using GitHub Actions by pjmlp on Wednesday April 24, 2024 @10:36AM (#40144901)
As proven by D, OCaml, F#, Delphi, Ada, C++23 (with modules, VC++/clang 18), it is a matter of toolchain.

What we need is a Rust interpreter, or having something like Cranelift properly integrated, to only depend on LLVM when doing release builds on the CI/CD.

Re:Golang PGO builds using GitHub Actions by KingOfCoders on Wednesday April 24, 2024 @11:27AM (#40145538)
Having used Scala for some years with it's abysmal compile speed, I fear it has to do with complexity of the language and features, it was "implicit" in Scala, it might be the borrow checker in Rust (IANACG)
Re:Golang PGO builds using GitHub Actions by pjmlp on Wednesday April 24, 2024 @12:36PM (#40146553)
Note that I left out Scala, while I included other languages of similar complexity, exactly because improving compile times has never been a major focus in Scala land, versus features.

Example, development effort wasted on Scala 3 Python like syntax.

There are several performance reports that show that the major culprit is the pile of LLVM IR sent to the backend.

Re:Golang PGO builds using GitHub Actions by steveklabnik on Wednesday April 24, 2024 @03:39PM (#40148660)
If you examine what takes time in the Rust compiler, the borrow checker is never a significant component.

The largest single bit tends to be codegen, which is why cargo check is so much faster than cargo build.

Re:Golang PGO builds using GitHub Actions by KingOfCoders on Wednesday April 24, 2024 @11:42PM (#40153165)
Ah!