🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.c
Article #2107

Re: optimising float3

#2107
From: fir
Date: Wed, 02 Dec 2026 20:10
50 lines
2539 bytes
fir pisze:
> bartc pisze:
>> On 30/11/2026 13:54, fir wrote:
>>> im a heavy user of float3
>>>
(...)

>>
>> You're passing a struct by value. C will do lots of copying here, 
>> which is likely to take longer than the savings of using SIMD.
>>
>> Use pointers instead.
>>
>> Even then, you are doing one operation at a time, each one having the 
>> function call overhead, even using pointers.
>>
>> For best efficiency, do lots of them in a loop within the same function.
>>
>> /Then/ look at possibly using SIMD. From C, lookup gcc SIMD intrinsics.
>>
>>
> you see the words inline? if i write inline functions then i guess
> passing by value and by pointer not makes difference...and i would 
> assume compiler is not so stupid to not not inline it...
> it generalli inlines quite heavier functions if asked, so he could
> inline small


btw i just noticed that people deneto f() inline at definition

inline f() {}

main()
{
   f();
}

ahere they also could denote it at call becouse sometimes you want it 
inline in one place and dont want to inline it in another

f() {}

main()
{
  inline f();
}


lack of it is somewhat an error
Technical Details
Message-ID: <11eptv7$3fp88$1@dont-email.me>
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu.MISMATCH!feed-us-txt.newsdeef.eu!feed-us-ny.newsdeef.eu!srv.newsdeef.eu!news.hispagatos.org!eternal-september.org!feeder.eternal-september.org!nntp.eternal-september.org!.POSTED!not-for-mail
References: <11ejv6f$fo9e$1@dont-email.me> <11ekiss$pbdj$1@dont-email.me> <11eko2r$rqht$1@dont-email.me>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu.MISMATCH!feed-us-txt.newsdeef.eu!feed-us-ny.newsdeef.eu!srv.newsdeef.eu!news.hispagatos.org!eternal-september.org!feeder.eternal-september.org!nntp.eternal-september.org!.POSTED!not-for-mail
From: fir <profesor.fir@gmail.com>
Newsgroups: comp.lang.c
Subject: Re: optimising float3
Date: Wed, 2 Dec 2026 21:10:07 +0100
Organization: A noiseless patient Spider
Lines: 50
Message-ID: <11eptv7$3fp88$1@dont-email.me>
References: <11ejv6f$fo9e$1@dont-email.me> <11ekiss$pbdj$1@dont-email.me>
 <11eko2r$rqht$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Wed, 02 Dec 2026 20:10:15 +0000 (UTC)
Injection-Info: dont-email.me;
	logging-data="3663112"; mail-complaints-to="abuse@eternal-september.org";	posting-account="U2FsdGVkX1+MqOHahbGSQokhF1n8b+p/7v0U841x1YQ="; posting-host="d8d88b06a7eda50b591c1c8e5ef4a90e"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:140.0) Gecko/20100101
 Firefox/140.0 SeaMonkey/2.53.24
Cancel-Lock: sha1:/2laOWKoqGZysFuOxqyeu7yA8Kg= sha256:JMMPiyoeov8zZ/zOFANzXBuvy4ZRJQO8e5XIAsMf978=
	sha1:MtbKThSZNHecgAYmMHpz+3jlzU4= sha256:J8TzS7tLR2LzgI1wZf6hFFSqlovl6DNbshMXSjbsCIU=
In-Reply-To: <11eko2r$rqht$1@dont-email.me>