Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » Community » Coffee corner » Some Experiment with Size of Upp Executable (Mostly some fun facts.)
Re: Some Experiment with Size of Upp Executable [message #57888 is a reply to message #57887] Mon, 27 December 2021 05:45 Go to previous messageGo to previous message
Lance is currently offline  Lance
Messages: 656
Registered: March 2007
Contributor
test 4: Unused class member has no cost.

Test code
#include <Core/Core.h>

using namespace Upp;

int BigFunction(int);

struct C
{
	void DoNothing(){}
	int Call(){ return BigFunction(1); }
};


CONSOLE_APP_MAIN
{
	C().DoNothing();
}

With
BigFunction()
same as Senario 1&2 in the last test. Both CLANGx64 and MSBT22x64 produced the same results as in Senario 2 in test 3, respectively. (Modern) C++ compilers (seem to) do very well on optimize out unused member functions. I know the test is not very well designed and is not convincing but let's believe in this until it's proven wrong. Laughing
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Quiz #2
Next Topic: Quiz #5
Goto Forum:
  


Current Time: Sun Aug 24 21:12:34 CEST 2025

Total time taken to generate the page: 0.03858 seconds