Profile-guided optimization

In computer programming, profile-guided optimization (PGO, sometimes pronounced as pogo[1]), also known as profile-directed feedback (PDF)[2] or feedback-directed optimization (FDO),[3] is the compiler optimization technique of using prior analyses of software artifacts or behaviors ("profiling") to improve the expected runtime performance of the program.

Method

Optimization techniques based on static program analysis of the source code consider code performance improvements without actually executing the program. No dynamic program analysis is performed. For example, inferring or placing formal constraints on the number of iterations a loop is likely to execute is fundamentally useful when considering whether to unroll it or not, but such facts typically rely on complex runtime factors that are difficult to conclusively establish. Usually, static analysis will have incomplete information and only be able to approximate estimates of the eventual runtime conditions.

The first high-level compiler, introduced as the Fortran Automatic Coding System in 1957, broke the code into blocks and devised a table of the frequency each block is executed via a simulated execution of the code in a Monte Carlo fashion in which the outcome of conditional transfers (as via IF-type statements) is determined by a random number generator suitably weighted by whatever FREQUENCY statements were provided by the programmer.[4]

Rather than programmer-supplied frequency information, profile-guided optimization uses the results of profiling test runs of the instrumented program to optimize the final generated code.[5][6][7] The compiler accesses profile data from a sample run of the program across a representative input set. The results indicate which areas of the program are executed more frequently, and which areas are executed less frequently. All optimizations benefit from profile-guided feedback because they are less reliant on heuristics when making compilation decisions. The caveat, however, is that the sample of data fed to the program during the profiling stage must be statistically representative of the typical usage scenarios; otherwise, profile-guided feedback has the potential to harm the overall performance of the final build instead of improving it.

Just-in-time compilation can make use of runtime information to dynamically recompile parts of the executed code to generate more efficient native code. If the dynamic profile changes during execution, it can deoptimize the previous native code, and generate a new code optimized with the information from the new profile.

Adoption

There is support for building Firefox using PGO.[8] Even though PGO is effective, it has not been widely adopted by software projects, due to its tedious dual-compilation model.[9] It is also possible to perform PGO without instrumentation by collecting a profile using hardware performance counters.[9] This sampling-based approach has a much lower overhead and does not require a special compilation.

The HotSpot Java virtual machine (JVM) uses profile-guided optimization to dynamically generate native code. As a consequence, a software binary is optimized for the actual load it is receiving. If the load changes, adaptive optimization can dynamically recompile the running software to optimize it for the new load. This means that all software executed on the HotSpot JVM effectively make use of profile-guided optimization.[10]

PGO has been adopted in the Microsoft Windows version of Google Chrome. PGO was enabled in the 64-bit edition of Chrome starting with version 53 and version 54 for the 32-bit edition.[11]

Google published a paper [12] describing a tool in use for using production profiles to guide builds resulting in up to a 10% performance improvement.

Implementations

Examples of compilers that implement PGO are:

See also

References

  1. ^ a b "Microsoft Visual C++ Team Blog". 12 November 2008.
  2. ^ "Profile-directed feedback (PDF)". XL C/C++ for AIX. Retrieved 23 November 2013.
  3. ^ Baptiste Wicht; Roberto A. Vitillo; Dehao Chen; David Levinthal (24 November 2014). "Hardware Counted Profile-Guided Optimization". arXiv:1411.6361. Bibcode:2014arXiv1411.6361W. {{cite journal}}: Cite journal requires |journal= (help)
  4. ^ J. W. Backus, R. J. Beeber, et al., The Fortran Automatic Coding System, Proceedings of the Western Joint Computer Conference, February 1957, p. 195
  5. ^ "K. Pettis, R. Hansen, Profile Guided Code Positioning, ACM SIGPLAN Programming Language Design and Implementation Conference 1990" (PDF).
  6. ^ a b "Intel Fortran Compiler 10.1, Professional and Standard Editions, for Mac OS X". Archived from the original on 28 September 2013.
  7. ^ "Profile-Guided Optimization (PGO) Quick Reference".
  8. ^ Building with Profile-Guided Optimization, mozilla.org, 13 August 2013
  9. ^ a b Dehao Chen (2010), "Taming hardware event samples for fdo compilation", Proceedings of the 8th annual IEEE/ACM international symposium on Code generation and optimization, pp. 42–52.
  10. ^ Ivanov, Vladimir (25 July 2013). "JVM JIT compilation overview". Retrieved 10 September 2016.
  11. ^ Marchand, Sébastien (31 October 2016). "Making Chrome on Windows faster with PGO". Archived from the original on 1 November 2016. Retrieved 1 November 2016.
  12. ^ Chen, Dehao; Li, David Xinliang; Moseley, Tipp (2016). "AutoFDO: Automatic feedback-directed optimization for warehouse-scale applications". Proceedings of the 2016 International Symposium on Code Generation and Optimization. New York, NY, USA. pp. 12–23. doi:10.1145/2854038.2854044. ISBN 978-1-4503-3778-6. S2CID 17473127.{{cite book}}: CS1 maint: location missing publisher (link)
  13. ^ "Profile-guided optimizations[VS 2019]". 18 October 2022.
  14. ^ "Profile-guided optimization [Clang Compiler User's Manual]".
  15. ^ Quintero, Dino; Chabrolles, Sebastien; Chen, Chi Hui; Dhandapani, Murali; Holloway, Talor; Jadhav, Chandrakant; Kim, Sae Kee; Kurian, Sijo; Raj, Bharath; Resende, Ronan; Roden, Bjorn; Srinivasan, Niranjan; Wale, Richard; Zanatta, William; Zhang, Zhi; Redbooks, I. B. M. (1 May 2013). IBM Power Systems Performance Guide: Implementing and Optimizing. IBM Redbooks. ISBN 978-0-7384-3766-8 – via Google Books.
  16. ^ "Optimize a Native Executable with Profile-Guided Optimizations [GraalVM How-to Guides]".
  17. ^ "What's new in .NET 6: Profile-guided optimization". 26 May 2023.
  18. ^ "Profile-guided optimization".

Read other articles:

يفتقر محتوى هذه المقالة إلى الاستشهاد بمصادر. فضلاً، ساهم في تطوير هذه المقالة من خلال إضافة مصادر موثوق بها. أي معلومات غير موثقة يمكن التشكيك بها وإزالتها. (نوفمبر 2019) هذه المقالة يتيمة إذ تصل إليها مقالات أخرى قليلة جدًا. فضلًا، ساعد بإضافة وصلة إليها في مقالات متعلقة بها...

 

Меккель Meckel —  громада  — Вид Меккель Прапор Герб Координати: 49°53′24″ пн. ш. 06°30′57″ сх. д. / 49.8900944° пн. ш. 6.5158806° сх. д. / 49.8900944; 6.5158806 Країна  Німеччина Земля Рейнланд-Пфальц Район Бітбург-Прюм Об'єднання громад Бітбургер-Ла...

 

جهاز متقدم لقياس الانبعاث الحراري والانعكاس الإشعاعيمعلومات عامةجزء من تيرا الكتلة 406 كيلوغرام الصانع ناساMinistry of International Trade and Industry (en) أحداث مهمة 18 ديسمبر 1999 : إطلاق صاروخ نقطة البداية Vandenberg Space Force Base Space Launch Complex 3 (en) مركبة الإطلاق الفضائية Atlas II (en) نوع المدار مدار أرضي من...

Bendito do Natal é uma canção de Natal tradicional portuguesa originária da região de Trás-os-Montes.[1]. Trata-se de um hino religioso tradicional cantado no Natal, desde 24 de dezembro até ao dia de Reis.[2] Surge publicado em 1959 na publicação periódica Douro Litoral: boletim da Comissão Provincial de Etnografia e História[2] O compositor português Fernando Lopes-Graça harmonizou este Bendito, tendo-o utilizado como nono andamento da sua Segunda Cantata do Natal, terminada e...

 

ملعب سانتياغو برنابيوEstadio Santiago Bernabéu (بالإسبانية) معلومات عامةأسماء سابقة ملعب تشيرمارتين (1947-1955)لقب البرنابيوالاسم الكامل ملعب سانتياغو برنابيوسمّي باسم سانتياغو بيرنابيو المنطقة الإدارية مدريد — Chamartín (en) البلد  إسبانيا موقع الويب realmadrid.com التشييد والافتتاحالمهندس ال

 

STINX Основна інформаціяЖанр Панк-рок, панк сайкобілі, ой, гаражний рок, гаражний панк, хардкор, стріт-панк[1]Роки 2005 — сьогодніКраїна  УкраїнаМісто КиївМова англійськаСклад Юрій Демиденко Олександр ЗброцькийВ'ячеслав ІваненюкКолишніучасники Володимир ЧеремисО...

Royal Naval Reserve unit in Tyne and Wear, England HMS Calliope, to the right on the river bank History United Kingdom NameHMS Calliope Commissioned1905 StatusCurrently operational Badge General characteristics Class and typeStone frigate HMS Calliope is a training centre and 'stone frigate' of the Royal Naval Reserve, located in Gateshead, Tyne and Wear. History A Tyne-based division of the Royal Naval Reserve was established in 1905, and used the old Calypso-class third-class cruiser HMS...

 

Torpedo boat of the United States Navy For other ships with the same name, see USS Fox. USS Fox (TB-13) in a West Coast harbor, circa the early 1910s. History United States NameFox NamesakeLieutenant Gustavus Vasa Fox later Assistant Secretary of the Navy Ordered10 June 1896 (authorised) BuilderWolff & Zwicker, Portland, OR Laid down4 March 1897 Launched4 July 1898 Sponsored byMiss V. Patterson Commissioned8 July 1899 Decommissioned1916 IdentificationTB-13 FateSold, 27 October 1916 Genera...

 

Vietnamese former standardized test This article does not cite any sources. Please help improve this article by adding citations to reliable sources. Unsourced material may be challenged and removed.Find sources: Universities and Colleges Selection Examination – news · newspapers · books · scholar · JSTOR (March 2023) (Learn how and when to remove this template message) This article is about the old Vietnamese admission test to colleges and universitie...

Vermont gubernatorial election 1839 Vermont gubernatorial election ← 1838 September 3, 1839 1840 →   Nominee Silas H. Jennison Nathan Smilie Party Whig Democratic Popular vote 24,611 22,251 Percentage 52.48% 47.45% Governor before election Silas H. Jennison Whig Elected Governor Silas H. Jennison Whig Elections in Vermont Federal government Presidential elections 1792 1796 1800 1804 1808 1812 1816 1820 1824 1828 1832 1836 1840 1844 1848 1852 1856 1860 1864 1868...

 

Si ce bandeau n'est plus pertinent, retirez-le. Cliquez ici pour en savoir plus. Cet article ne s'appuie pas, ou pas assez, sur des sources secondaires ou tertiaires (juin 2018). Pour améliorer la vérifiabilité de l'article ainsi que son intérêt encyclopédique, il est nécessaire, quand des sources primaires sont citées, de les associer à des analyses faites par des sources secondaires. Pont du Gard Cet article fait un point rapide sur les ressources touristiques du département fran...

 

Playful leisure activity This article has multiple issues. Please help improve it or discuss these issues on the talk page. (Learn how and when to remove these template messages) This article is an orphan, as no other articles link to it. Please introduce links to this page from related articles; try the Find link tool for suggestions. (May 2021) This article needs additional citations for verification. Please help improve this article by adding citations to reliable sources. Unsourced materi...

Hellerup Parochie van Denemarken Situering Bisdom Bisdom Funen Gemeente Faaborg-Midtfyn Coördinaten 55°17'6,1NB, 10°34'22,0OL Algemeen Inwoners (2004) 241 Leden Volkskerk (2004) 212 Overig Kerken Hellerup Kirke Proosdij Midtfyn Provsti Pastoraat Herrested-Søllinge-Hellerup Foto's Kerk Portaal    Denemarken Hellerup is een parochie van de Deense Volkskerk in de Deense gemeente Faaborg-Midtfyn. De parochie maakt deel uit van het bisdom Funen en telt 212 kerkleden op een bevolking ...

 

Railway station in Glasgow, ScotlandNot to be confused with Kings Park (LIRR station). King's ParkScottish Gaelic: Pàirc an Rìgh[1]Overview of the station, looking west towards Langside and Mount FloridaGeneral informationLocationKing's Park, GlasgowScotlandCoordinates55°49′10″N 4°14′48″W / 55.81958°N 4.24653°W / 55.81958; -4.24653Grid referenceNS593607Managed byScotRailPlatforms2Other informationStation codeKGPHistoryOriginal companyLondon, Midla...

 

Not to be confused with St. Anne's Hospital in Haringey, London. Hospital in EnglandSt Ann's HospitalDorset HealthCare University NHS Foundation TrustSt Ann's HospitalShown in DorsetGeographyLocationPoole, Dorset, England, United KingdomCoordinates50°42′00″N 1°55′41″W / 50.700°N 1.928°W / 50.700; -1.928OrganisationCare systemNHSTypePsychiatric HospitalAffiliated universityNoneServicesEmergency departmentNo Accident & EmergencyBeds86HistoryOpened1912Link...

2012 video gameSpliceDeveloper(s)Cipher PrimeEngineUnityPlatform(s)Microsoft Windows, OS X, Linux, iOS, Android, PlayStation 3, PlayStation 4ReleaseJune 13, 2012Genre(s)Puzzle, StrategyMode(s)Single-player Splice is a puzzle game developed by Philadelphia-based independent game studio Cipher Prime.[1] Splice was released in 2012, and is available for PC, Mac, Linux, iPad, and Android.[2] Splice is no longer available for download on Google Play. Gameplay The player progresses ...

 

يفتقر محتوى هذه المقالة إلى الاستشهاد بمصادر. فضلاً، ساهم في تطوير هذه المقالة من خلال إضافة مصادر موثوق بها. أي معلومات غير موثقة يمكن التشكيك بها وإزالتها. (ديسمبر 2018) صقور منتصف الليل     الإنشاء 1997  الموقع الرسمي الموقع الرسمي  تعديل مصدري - تعديل   فريق صقور م...

 

European investing and trading broker This article needs additional citations for verification. Please help improve this article by adding citations to reliable sources. Unsourced material may be challenged and removed.Find sources: Cortal Consors – news · newspapers · books · scholar · JSTOR (August 2020) (Learn how and when to remove this template message) Cortal Consors SA was a European broker in personal investing and online trading. Formed by a m...

German politician (born 1965) Christine LambrechtLambrecht in 2022Minister of DefenceIn office8 December 2021 – 19 January 2023ChancellorOlaf ScholzPreceded byAnnegret Kramp-KarrenbauerSucceeded byBoris PistoriusMinister of Family Affairs, Senior Citizens, Women and YouthIn office20 May 2021 – 8 December 2021ChancellorAngela MerkelPreceded byFranziska GiffeySucceeded byAnne SpiegelMinister of Justice and Consumer ProtectionIn office27 June 2019 – 8 December 20...

 

Musical instrument of the bagpipe family This article is about the 18th century French bagpipe. For other uses of musette, see Musette (disambiguation). An 18th-century musette de cour on display at the Berlin Musical Instrument Museum, Germany Gaspard de Gueidan playing the musette de cour, painting by Hyacinthe Rigaud, 1738, Musée Granet, Aix-en-Provence, France Drawing of the parts of the musette de cour from the Encyclopédie by Diderot and d'Alembert, ca. 1770 The musette de cour or bar...

 

Strategi Solo vs Squad di Free Fire: Cara Menang Mudah!