-
Path: news-archive.icm.edu.pl!news.gazeta.pl!newsfeed.pionier.net.pl!news-2.dfn.de!ne
ws.dfn.de!news.uni-stuttgart.de!news.nask.pl!news.nask.org.pl!news.internetia.p
l!not-for-mail
From: Jakub Debski <d...@w...pl>
Newsgroups: pl.comp.programming,pl.comp.lang.c
Subject: Re: Wywołanie wirtualne kontra wskaźnik do funkcji - optymalizacja
Date: Thu, 06 Aug 2009 11:52:49 +0200
Organization: Netia S.A.
Lines: 36
Message-ID: <m...@w...pl>
References: <h5d3t9$g7h$1@inews.gazeta.pl>
NNTP-Posting-Host: 77-252-162-178.ip.netia.com.pl
Mime-Version: 1.0
Content-Type: text/plain; charset="iso-8859-2"; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: mx1.internetia.pl 1249553070 5805 77.252.162.178 (6 Aug 2009 10:04:30 GMT)
X-Complaints-To: a...@i...pl
NNTP-Posting-Date: Thu, 6 Aug 2009 10:04:30 +0000 (UTC)
X-Tech-Contact: u...@i...pl
X-Plugin-FACETOCH: http://chasta971.free.fr/mesnews/
X-Newsreader: MesNews/1.08.03.00-gb
Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAMFBMVEUEAgSPDARSEQQcFAvQBgQ0FQ
ZwDwSxCQQnDgbrBAQMDQxoFwQWEhQkDBQXDhRJFgT6HB4IAAAACXBIWXMAAAsTAAALEwEAmpwYAAAB
v0lEQVR4nNWSv0sjQRTHB0VZhmvWHwHLLBeLawI+dpFB7hAEWa7SYRQOZMmoK1ayEFyOqw6xsRMCIV
1ku4dwlX+B3ZL/wkaCpIishRZxNoLuZNY/4KZ8H77f9+a9LyH/5aPlZUwRsWvWE+B9RdAAQogelhDq
OLW9wVpquFkN+0QAPPRySZFZC1FlJATPgeZmLW1GjlPP+3S1sa3mRlwJ63xgTLzUUqC21zfAwRjwMd
CafO1ElVAKUC30ka/8dQVqHPEWWBHM+m3bjg4Bwa3zopf1uxNHG/spQiKY8npntNHstGMOwDFJi4DA
9sJlxjC4gfHCPtrQ6yBkXfTCWp/1ioAkox3Wpbutw8HqQPvl9NOyAt6pcAVPi4AezDHEBFwRaPMSuh
XmF7w+D0Y6IK53oRR3rgHQ+4WojII608GXnWdET6pzMX3509VviD9s6WQTClqdx3sYhjJTV9EkW3Nn
AYOhfJyM19RmuI8gHD4ZVstvL4qXbLhmpPi4HcvGnxEzkvr3qCkDO2OGYmZbOg07bzGZot3Y7/z8jm
bsr1p+64ahKaHLTsaxBJAV+dgrcSLkX1jqpLwA3uqmiOL7+xS8Ai8E6F0cB40CAAAAAElFTkSuQmCC
X-Face: =a,yA}ET[E$'Ukoo$iL|^i5vJ>Z.={}a.hUP,Y~!:yAm={Ov6$|vV63nNMe*sPb4IQ3`js-
2dGXf?A#HXe<2Q|Pu1[k6!z:x[D\G5(Y]dnoY}}gc\3GQS{p49"FU^B3i`"1I=[e4R5v**LG7a[]z,
@/Hf*7=#YEg`
X-Server-Info: http://www.internetia.pl/news/
Xref: news-archive.icm.edu.pl pl.comp.programming:183033 pl.comp.lang.c:283985
[ ukryj nagłówki ]on 2009-08-06, Mariusz Marszałkowski supposed :
> Czy w kompilatorach C++ ktoś zaimplementował jakieś optymalizacje do
> metod wirtualnych? Chodzi mi o jakąś technikę, dzięki której kompilator
> może wygenerować szybszy kod dla wywołań wirtualnych niż dla zwykłych
> wskaźników do funkcji.
Visual C++ od wersji 2005 przy użyciu Profile-Guided Optimization robi:
Virtual Call Speculation. Virtual calls can be expensive due to the
jumping through the vtable to invoke method. With PGO, the compiler can
speculate at the call site of a virtual call and inline the method of
the speculated object into the virtual call site; the data to make this
decision is gathered with the instrumented application. In the
optimized code, the guard around the inlined function is a check to
ensure that the type of the speculated object matches the derived
object.
G++ od wersji 3.0 ma:
If the library exports constructors to the user,
all the user callable virtual functions of the
class and its ancestors must be exported. Although
virtual functions are normally called
via the vtable (and therefore their names are
not needed, just the index in the vtable), by exposing
the constructor it might be possible to
determine the dynamic type of an expression at
compile time. Should the compiler do that, it
may elect to replace a virtual call with a direct
call, and hence require the name of the virtual
function.
pozdrawiam,
Jakub
Następne wpisy z tego wątku
- 09.08.09 20:17 MaciejS
- 10.08.09 03:43 Mariusz Marszałkowski
- 10.08.09 07:42 MaciejS
- 10.08.09 10:39 Mariusz Marszałkowski
Najnowsze wątki z tej grupy
- Do czego nadaje się QDockWidget z bibl. Qt?
- Bibl. Qt jest sztucznie ograniczona - jest nieprzydatna do celów komercyjnych
- Co sciaga kretynow
- AEiC 2024 - Ada-Europe conference - Deadlines Approaching
- Jakie są dobre zasady programowania programów opartych na wtyczkach?
- sprawdzanie słów kluczowych dot. zła
- Re: W czym sie teraz pisze programy??
- Re: (PDF) Surgical Pathology of Non-neoplastic Gastrointestinal Diseases by Lizhi Zhang
- CfC 28th Ada-Europe Int. Conf. Reliable Software Technologies
- Młodzi programiści i tajna policja
- Ada 2022 Language Reference Manual to be Published by Springer
- Press Release - AEiC 2023, Ada-Europe Reliable Softw. Technol.
- Ada-Europe - AEiC 2023 early registration deadline approaching
- Ada-Europe Int.Conf. Reliable Software Technologies, AEiC 2023
- Ile cykli zajmuje mnożenie liczb 64-bitowych?
Najnowsze wątki
- 2024-05-20 Fiat 125p wer. pikup - w PRL moszna było, w III Reczy [pospolitej] nie moszna
- 2024-05-19 Pożar salonu z chińskimi elektrykami
- 2024-05-18 LED
- 2024-05-19 ceny nieruchomości
- 2024-05-18 Szczecin => UX/UI Designer <=
- 2024-05-18 Warszawa => Mid PHP Developer (Laravel) <=
- 2024-05-18 Warszawa => Software .Net Developer <=
- 2024-05-18 Warszawa => Mid/Senior QA Engineer <=
- 2024-05-18 Ulm => Solution Architect (sichere Kommunikation und IoT-Loesungen <=
- 2024-05-18 Katowice => Head of Virtualization Platform Management and Operating S
- 2024-05-18 Warszawa => SAP WM Consultant / Execution <=
- 2024-05-18 Wrocław => Consultant/Implementer Comarch ERP XL <=
- 2024-05-18 Gdańsk => Head of International Freight Forwarding Department <=
- 2024-05-18 Warszawa => Account Manager (Recruitment Services) <=
- 2024-05-18 Łódź => Salesperson - CRM Systems <=