When your question is answered use !solved to mark the question as resolved.
Remember to ask specific questions, provide necessary details, and reduce your question to its simplest form. For tips on how to ask a good question use !howto ask.
36 messages ยท Page 1 of 1 (latest)
When your question is answered use !solved to mark the question as resolved.
Remember to ask specific questions, provide necessary details, and reduce your question to its simplest form. For tips on how to ask a good question use !howto ask.
Maybe I don't know something, but how will this help?
How is it different compared to just having a long function
Dude, I'm not sure, for example chatgpt warns me about this, I've read articles in many communities but he says it can give bad performance in long functions.
chatgpt just tells me not to use it in long functions
I'm just not sure if it's a step forward.
I mean, if the point of __forceinline is to have the same performance as if you pasted the function body instead of calling it, then moving stuff to forceinline functions shouldn't change anything
But you can measure it, maybe something will change?
He = who?
chatgpt ๐
We highly recommend against the use of LLMs and AI assistants because:
I compared the old and the new to artificial intelligence.
I agree with what you said
thanks buddy
Not sure if you're being sarcastic ๐
Basically, this: #1386673954844053595 message
It shouldn't make any difference. But test it yourself if you want to know for sure
@brave patrol Has your question been resolved? If so, type !solved :)
ha
the probabilty you have sufficent insight into the advantages for a __forceinline is slim. everything you'd need to know to make an informed decision is already stuff the compiler knows.
__forceinline doesn't help with network code since the corresponding kernel-calls for networking are rather expensive.
I'll try and see, I don't think he'll come out ahead.
Stop
optimizing c++ code
god damn, you can just optimize it later, you need just to care about 3 things: copy of objects, memory safety, and, probably, memory secure
Maybe I misread the question, but I think he's comparing one long function vs it split into several __forceinline smaller functions? Which sounds weird
why so? if compiler for some reason not optimize, it may help
if case is something like
auto very_long_func() -> deduce_idk {
// this func was > 60 lines of code long
auto r1 = helper1();
auto r2 = helper2(r1);
auto r3 = helper3(r2);
return helper4(r3);
}
the moment you bring networking to your code, the network will be ur speed bottleneck 
don't ever trust any numbers chatgpt gives you, it just makes stuff up.. and take the other stuff with a grain of salt
means: 1. dont believe to chat gpt 2. dont be 100% sure of stuff other ppl saying
i was 100% sure that vector use mem*** operations for removing/relocating etc. operations for all types, because somebody said it long long time ago, until it dont, and was never done
I don't have a lot of c ++ skills, I read a lot of articles, but I get help from artificial intelligence most of the time, when it says something that will put it forward, I don't add it directly to my code, I research it as much as I can, I verify it, then I add it, I give codes focused on convincing us in most cases of artificial intelligence.
So why not test this? And compare the performance
This depends on the compiler. I wish I had a good analogy, but there's no real straight-forward answer to this kind of question. Based on __forceinline I assume this is CL. For single-use functions, yes you generally want them inlined. It's rather suspicious that the implementation wouldn't do this already with optimizations enabled, so I feel like you're not providing all the relevant information to adequately answer your question. You have to read the codegen, this blanket advice stuff is more like shooting in the dark.
I'll try tonight, I'm at work, man.