-
Data: 2009-08-06 09:52:49
Temat: Re: Wywołanie wirtualne kontra wskaźnik do funkcji - optymalizacja
Od: Jakub Debski <d...@w...pl> szukaj wiadomości tego autora
[ pokaż wszystkie 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
- Grok zaczął nadużywać wulgaryzmów i wprost obrażać niektóre znane osoby
- Can you activate BMW 48V 10Ah Li-Ion battery, connecting to CAN-USB laptop interface ?
- We Wrocławiu ruszyła Odra 5, pierwszy w Polsce komputer kwantowy z nadprzewodzącymi kubitami
- Ada-Europe - AEiC 2025 early registration deadline imminent
- John Carmack twierdzi, że gdyby gry były optymalizowane, to wystarczyły by stare kompy
- Ada-Europe Int.Conf. Reliable Software Technologies, AEiC 2025
- Linuks od wer. 6.15 przestanie wspierać procesory 486 i będzie wymagać min. Pentium
- ,,Polski przemysł jest w stanie agonalnym" - podkreślił dobitnie, wskazując na brak zamówień.
- Rewolucja w debugowaniu!!! SI analizuje zrzuty pamięci systemu M$ Windows!!!
- Brednie w wiki - hasło Dehomag
- Perfidne ataki krakerów z KRLD na skrypciarzy JS i Pajton
- Instytut IDEAS może zacząć działać: "Ma to być unikalny w europejskiej skali ośrodek badań nad sztuczną inteligencją."
- Instytut IDEAS może zacząć działać: "Ma to być unikalny w europejskiej skali ośrodek badań nad sztuczną inteligencją."
- Instytut IDEAS może zacząć działać: "Ma to być unikalny w europejskiej skali ośrodek badań nad sztuczną inteligencją."
- U nas propagują modę na SI, a w Chinach naukowcy SI po kolei umierają w wieku 40-50lat
Najnowsze wątki
- 2025-07-23 Gdańsk => Programista Delphi <=
- 2025-07-23 Gdańsk => Programista Mainframe (z/OS, Assembler) <=
- 2025-07-23 Warszawa => Starszy inżynier DevOps (AWS) <=
- 2025-07-23 Gdańsk => Mainframe (z/OS, Assembler) Developer <=
- 2025-07-23 Kraków => Senior Fullstack Engineer (Low-Code Platform) <=
- 2025-07-23 Wrocław => Senior Key Account Manager IT <=
- 2025-07-23 Trójmiasto => Head of Social Media <=
- 2025-07-23 Rzeszów => Spedytor Międzynarodowy <=
- 2025-07-23 Lublin => ERP Implementation Consultant (AP Module) <=
- 2025-07-23 Środa Wielkopolska => SAP FI/CO Internal Consultant <=
- 2025-07-23 Warszawa => Inżynier oprogramowania .Net <=
- 2025-07-23 Kraków => Kotlin Developer <=
- 2025-07-23 Żerniki => Dyspozytor Międzynarodowy <=
- 2025-07-23 Warszawa => Java Developer <=
- 2025-07-23 Wrocław => Konsultant wdrożeniowy (systemy controlingowe) <=