Recent

Author Topic: simple fpc vs gcc benchmark  (Read 1597 times)

fcu

  • Full Member
  • ***
  • Posts: 129
Re: simple fpc vs gcc benchmark
« Reply #15 on: March 22, 2026, 10:01:15 am »
thanks to everybody
the trick is
inlining those functions :

function Vec2(x, y: Single): TVec2;
function Vec3(x, y, z: Single): TVec3;
function Vertex(pos: TVec3; uv: TVec2): TVertex;
function Triangle(v0, v1, v2: TVertex);TTriangle;

and precompute (cc := Vec2(x+0.5,y+0.5);) as d4eva mentioned

the fps becomes 46 from 16( original ) , that seems good and its near equal to the c++ version
that shows that fpc is doing great job

backprop

  • Full Member
  • ***
  • Posts: 224
Re: simple fpc vs gcc benchmark
« Reply #16 on: March 22, 2026, 10:40:52 am »
Also consider to use sincos function for the same argument, instead to calculate it separately, as these functions are complementary and no extra cycles are wasted to calculate it separately.

 

TinyPortal © 2005-2018