News for hackers. Stuff that matters.
Re:Comparing C and C++ usage and performance with a real wor... by mcguire on Sunday September 03, 2017 @04:18PM (#15163628)
Yes, although (cache behavior notwithstanding) it's a single pointer indirection that can frequently be optimized away by the compiler.
Re:Comparing C and C++ usage and performance with a real wor... by khitchdee on Sunday September 03, 2017 @08:21PM (#15164761)
My point is simply this -- adding protection mechanisms and inheritance to classes neccesitates adding more complexity to the structure used to represent them (such as a vtable) which does add performance overheads. If you dont need those features, you can go leaner and faster with a C structure that includes function pointers to give you the basic packaging of data and functions that an object has.