Ada Performance Issue?

-gnatn[2] magically becomes -gnat[2] ?

gnatmake -O3 -fomit-frame-pointer -march=ivybridge -gnatn[2] -f binarytrees.adb -o binarytrees.gnat_run -largs -lapr-1
x86_64-linux-gnu-gcc-13 -c -O3 -fomit-frame-pointer -march=ivybridge -gnatn[2] binarytrees.adb
gnat1: invalid switch: -gnat[2]

That would be -gnatn, -gnatn1, or -gnatn2

…and as C programmers will tell you, those checks aren’t necessary, because They Know What They’re Doing ™.

4 Likes

-gnatn2 it is then.

Your post was flagged as spam

Meanwhile, the communities of newer programming languages take every opportunity to promote them.

It’s an automated filter that triggers when a new user posts a lot of links. I’ve restored your posts.

1 Like

I’m not familiar with exactly what he did, but it’s often more complex than that. Comparisons often include text I/O, for example, and Ada.Text_IO is more complex than C’s text-I/O facilities.

Ada.Text_IO.Put_Line (Item => "Hello");

does more than just output “Hello”. It also sets the current column to 1 and increments the current line. Depending on how it’s implemented, it could also increment the current column 5 times before setting it to 1. Even importing the C subprograms and calling them using Interfaces.C.To_C introduces additional operations not present in the C.

1 Like