[GiNaC-devel] tinfo
Jens Vollinga
vollinga at physik.uni-wuppertal.de
Fri Nov 11 12:00:39 CET 2005
Hi,
Christian Bauer wrote:
> 2) The main reason behind the TINFO mechanism was to avoid a virtual
> function call. This and some other optimizations sped up GiNaC by a
> factor of two.
That's interesting information! Then of course, the proposed mechanism
is no longer acceptable.
But, "Never give up, never surrender" (Galaxy Quest),
what about the folling code. There is no such overhead involved:
class SOMECLASS
{
public:
const static char* tinfo_name;
unsigned tinfo;
SOMECLASS()
{
tinfo = (unsigned)tinfo_name;
}
};
const char* SOMECLASS::tinfo_name= "SOMECLASS";
class daughter : public SOMECLASS
{
public:
const static char* tinfo_name;
daughter()
{
tinfo = (unsigned)tinfo_name;
}
};
const char* daughter::tinfo_name= "daughter";
Regards,
Jens
More information about the GiNaC-devel
mailing list