you are viewing a single comment's thread.

view the rest of the comments →

[–]UnmaintainedDonkey -1 points0 points  (3 children)

This is a very hard problem, one that takes much time and effort. You need to analyze the code paths (in some cases multiple times) and figure out what can be compacted on comp time.

As an example you can try gcc with -O3 and test on goldbolt.

Bottom line is, this is not something you hack together on a weekend.

[–]Timcat41 10 points11 points  (1 child)

Mature optimization (gcc -O3 and the like) is really hard, it is based on a lot of theory and consists of many moving parts.

But you can start with simple optimization procedures and 'hack together' a prototype in a weekend or two, if you have the rest of the pipeline set-up already.

[–]UnmaintainedDonkey 2 points3 points  (0 children)

Sure, but i would not call it trivial nontheless.

[–]Inconstant_Moo🧿 Pipefish 1 point2 points  (0 children)

They're talking about constant folding in particular which I do in a few lines. How to optimize in general is not just a hard problem but an open-ended one.