Article View: pl.comp.objects
Article #16013Optymalizacja superklas
From: Miroslaw.Makowiecki
Date: Wed, 28 Mar 2007 14:41
Date: Wed, 28 Mar 2007 14:41
19 lines
1748 bytes
1748 bytes
Mamy oto klasę numer 1;
class klasa1:public ifstream
{
void open(char const*path){
static_cast<ifstream*>(this>->open(path);
}
};
klasę numer 2
class klasa2:public klasa2
{
void open(char const*path){
static_cast<klasa1*>(this)->open(path);
}
Jak widzimy klasy klasa1 i klasa2 robią dokładnie to samo,jak
zauważyłem z mojego doświadczenia klasa klasa2 działa wolniej niż
klasa klasa1.
Pytanie: Czy istnieje jakaś opcja optymalizacji oprogramowania w
kompilatorze g++-4.2 języka c++ która powoduje że szybkość działania
klas klasa1 i klasa2 są jednakowe?
Technical Details
Message-ID:
<1175092885.381256.240220@y66g2000hsf.googlegroups.com>Path:
mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!newsfeed.gazeta.pl!news.nask.pl!news.nask.org.pl!news.germany.com!postnews.google.com!y66g2000hsf.googlegroups.com!not-for-mailShow Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!newsfeed.gazeta.pl!news.nask.pl!news.nask.org.pl!news.germany.com!postnews.google.com!y66g2000hsf.googlegroups.com!not-for-mail From: Miroslaw.Makowiecki@gmail.com Newsgroups: pl.comp.objects Subject: Optymalizacja superklas Date: 28 Mar 2007 07:41:25 -0700 Organization: http://groups.google.com Lines: 21 Message-ID: <1175092885.381256.240220@y66g2000hsf.googlegroups.com> NNTP-Posting-Host: 83.18.174.178 Mime-Version: 1.0 X-Trace: posting.google.com 1175092887 16367 127.0.0.1 (28 Mar 2007 14:41:27 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Wed, 28 Mar 2007 14:41:27 +0000 (UTC) User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (compatible; Konqueror/3.5; Linux 2.6.18-1-686; X11; i686; pl) KHTML/3.5.5 (like Gecko) (Debian package 4:3.5.5a.dfsg.1-6),gzip(gfe),gzip(gfe) X-HTTP-Via: 1.0 HAVP, 1.0 zwolen:8080 (squid/2.5.STABLE9) Complaints-To: groups-abuse@google.com Injection-Info: y66g2000hsf.googlegroups.com; posting-host=83.18.174.178; posting-account=ZtCzpw0AAAB7bcDRjtJwIIcbCszsYq0O Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit