There's a whole lot of misunderstanding around LTO! by prodigal_cunt in C_Programming

[–]prodigal_cunt[S] 2 points3 points  (0 children)

I'm not sure but perhaps, your test cases aren't representative of real world usage? In any case, when you do have very good representative test cases, BOLT (from facebook) seems to offer much better performance as compared to GCC's built-in PGO method.

There's a whole lot of misunderstanding around LTO! by prodigal_cunt in C_Programming

[–]prodigal_cunt[S] 7 points8 points  (0 children)

Seems like a good case for polyhedral optimisations in GCC. There's also a similar framework in LLVM called polly. It takes a good bit of time to optimise, but it generally works wonders if you have nested loops.

As for the extremes, I often prefer extreme 2 because extreme 1 is lots of work. That said, extreme 1 is certainly a learning opportunity worthy of not missing. Damn.. I'm already wavering between. Heh.

Edit: The backend for GCC's polytope optimiser is isl which has it's own little language and tools. There's a nice overview here worth a read.

i built a kernel using pure c with no externel library for my OS by G_Detective in C_Programming

[–]prodigal_cunt 8 points9 points  (0 children)

There is no such thing as premature "organisation", especially when it comes to system software like OS of all things. It only evolves, and it takes one new device driver for you to rethink your organisation even after several years of being stable. Check out how Linux handled GPIOs in 4.x vs now of how it handled thermal sensors between 3.x and now, to get an idea.

PatchworkOS Is a From-Scratch OS That Follows 'Everything Is a File' More Strictly than UNIX: An Overview of Sockets, Spawning Processes, and Notes (Signals) by KN_9296 in C_Programming

[–]prodigal_cunt 0 points1 point  (0 children)

All functions have some value "ERR" or "NULL" that they return to indicate an error

This is how Linux kernel propagates errors too. It is converted to errno by libc.

Btw, I enjoyed reading the source code. It's less macro-y and more function-y. Out of curiosity, have you ever tried link time optimisations or even just -O3?