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 » U++ Library support » U++ Core » Small optimization
Small optimization [message #57056] Tue, 18 May 2021 15:36 Go to previous message
Didier is currently offline  Didier
Messages: 680
Registered: November 2008
Location: France
Contributor
Hello Mirek,

I have a small optimisation proposition for cases where fundamental data types are used

in Vcont.h

Replace:
template <class T>
inline void Construct(T *t, const T *lim) {
	while(t < lim)
		new(t++) T;
}



with:
template <class T>
inline void Construct(T *t, const T *lim) {
	if ( ! std::is_fundamental<T>::value ) {
		while(t < lim)
			new(t++) T;
	}
}


Other methods near this one can benefit from this small optimisation (Destroy for example)

Note: Tested on my app : everything seems to work fine

[Updated on: Tue, 18 May 2021 16:58]

Report message to a moderator

 
Read Message
Read Message
Read Message
Previous Topic: DarkThemeCached
Next Topic: SIGPIPE problem
Goto Forum:
  


Current Time: Mon Apr 29 13:45:13 CEST 2024

Total time taken to generate the page: 0.01993 seconds