Click here to Skip to main content
15,885,244 members

Welcome to the Lounge

   

For discussing anything related to a software developer's life but is not for programming questions. Got a programming question?

The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.

 
GeneralRe: So this is satisfying. Free code performance upgrade! Pin
Greg Utas10-Jul-22 1:26
professionalGreg Utas10-Jul-22 1:26 
GeneralRe: So this is satisfying. Free code performance upgrade! Pin
Eddy Vluggen10-Jul-22 3:57
professionalEddy Vluggen10-Jul-22 3:57 
GeneralRe: So this is satisfying. Free code performance upgrade! Pin
jmaida10-Jul-22 9:53
jmaida10-Jul-22 9:53 
GeneralRe: So this is satisfying. Free code performance upgrade! Pin
Greg Utas10-Jul-22 15:17
professionalGreg Utas10-Jul-22 15:17 
GeneralRe: So this is satisfying. Free code performance upgrade! Pin
jmaida10-Jul-22 15:41
jmaida10-Jul-22 15:41 
GeneralRe: So this is satisfying. Free code performance upgrade! Pin
jmaida10-Jul-22 15:42
jmaida10-Jul-22 15:42 
GeneralRe: So this is satisfying. Free code performance upgrade! Pin
jmaida10-Jul-22 15:47
jmaida10-Jul-22 15:47 
GeneralRe: So this is satisfying. Free code performance upgrade! Pin
honey the codewitch10-Jul-22 19:10
mvahoney the codewitch10-Jul-22 19:10 
Greg Utas wrote:
When C++ calculates things at compile time, it's usually a case of using more memory to run faster, at least when templates are involved.


I disagree with this. Where I'm using templates to do precomputed things, it's not increasing memory use at all, but simply flexibility of my API.

For example, an RGB565 pixel is 16 bits, with 5 bits for Red, 6 bits for Green and 5 bits for Blue

To pick off or set individual channels requires bitshifting and masking

I use templates to facilitate

A) Querying pixels, so you can do like rgb_pixel<16>::has_channel_names<channel_name::R, channel_name::G>::value (will be bool true)
B) Picking/Setting off arbitrary pixel channel data like px.template channel<channel_name::G>(); which returns the green channel
C) Doing bitmap manipulation using the binary footprint implied by the constructed pixels, which can have any number of channels with any sort of names - RGB is just one example)

None of this is about trading speed for memory.

It's about buying flexibility. Period.

There is no case in GFX where I use computed compilation to trade performance aspects. It's all about flexibility while maintaining the same kind of performance you get without it.

In fact, forgive me but I can't think of a situation like you describe.
To err is human. Fortune favors the monsters.

GeneralRe: So this is satisfying. Free code performance upgrade! Pin
Greg Utas11-Jul-22 0:09
professionalGreg Utas11-Jul-22 0:09 
GeneralRe: So this is satisfying. Free code performance upgrade! Pin
honey the codewitch11-Jul-22 0:26
mvahoney the codewitch11-Jul-22 0:26 
GeneralRe: So this is satisfying. Free code performance upgrade! Pin
honey the codewitch10-Jul-22 19:13
mvahoney the codewitch10-Jul-22 19:13 
GeneralRe: So this is satisfying. Free code performance upgrade! Pin
jmaida11-Jul-22 10:13
jmaida11-Jul-22 10:13 
GeneralRe: So this is satisfying. Free code performance upgrade! Pin
jmaida11-Jul-22 11:18
jmaida11-Jul-22 11:18 
GeneralWordle 386 Pin
Amarnath S9-Jul-22 15:02
professionalAmarnath S9-Jul-22 15:02 
GeneralRe: Wordle 386 Pin
Peter_in_27809-Jul-22 16:15
professionalPeter_in_27809-Jul-22 16:15 
GeneralRe: Wordle 386 Pin
OriginalGriff9-Jul-22 18:46
mveOriginalGriff9-Jul-22 18:46 
GeneralRe: Wordle 386 - 4 again Pin
pkfox9-Jul-22 20:29
professionalpkfox9-Jul-22 20:29 
GeneralRe: Wordle 386 Pin
Sandeep Mewara9-Jul-22 21:29
mveSandeep Mewara9-Jul-22 21:29 
GeneralRe: Wordle 386 Pin
Sander Rossel9-Jul-22 22:02
professionalSander Rossel9-Jul-22 22:02 
GeneralRe: Wordle 386 Pin
ChandraRam10-Jul-22 0:16
ChandraRam10-Jul-22 0:16 
GeneralRe: Wordle 386 Pin
Greg Utas10-Jul-22 0:51
professionalGreg Utas10-Jul-22 0:51 
GeneralRe: Wordle 386 Pin
Cp-Coder10-Jul-22 1:22
Cp-Coder10-Jul-22 1:22 
GeneralRe: Wordle 386 Pin
jmaida10-Jul-22 15:00
jmaida10-Jul-22 15:00 
GeneralWordle 385 Pin
Amarnath S8-Jul-22 16:41
professionalAmarnath S8-Jul-22 16:41 
GeneralRe: Wordle 385 Pin
OriginalGriff8-Jul-22 18:40
mveOriginalGriff8-Jul-22 18:40 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.