Facebook Präprozessor für C und C++





  • Schau mal aufs Datum 💡 ⚠


  • Mod

    Hängt gänzlich davon ab, ob folgendes die Wahrheit ist oder Werbung:

    Conventional wisdom has it that preprocessing time is a negligible part of building a C++ binary. C++ is notoriously difficult to parse, which means that C++ parsers tend to be large and slow compared to their counterparts for other languages. Code generation is also quite the time sink, especially if you're using optimizations. Finally, linking is a large serial step at the end of each build, and using the gold linker only helps so much. Therefore, it would seem that the lowly task of going through the included files and expanding macros would take a comparatively short time and be essentially impossible to improve upon.

    Not so! Replacing gcc's preprocessor with warp has led to significant improvements of our end-to-end build times (including linking). Depending on a variety of circumstances, we measured debug build speed improvements ranging from 10% all the way to 40%, all in complex projects with massive codebases and many dependencies. That's not per-file speed, but rather global times measured for scenarios like "build after changing a header file."

    Falls das stimmt: 👍 Kann man sich mal angucken.
    Ich fürchte bloß, die Messungen werden wahrscheinlich nicht ganz objektiv sein und man kann den gleichen Effekt mit ordentlich RAM und/oder einem flotten Massenspeichergerät erzielen. Die auf dem Buildsystem ohnehin schon vorhanden sein sollten.

    Kenner der Aprilscherze schrieb:

    Schau mal aufs Datum 💡 ⚠

    😕 Der Artikel ist doch von letzter Woche oder sehe ich das gerade falssch?



  • Den Artikel kann man vergessen, das ist ein reiner Lobgesang auf D und Mikrooptimierungen.

    Die Zahlen: 10% Speedup im Debug-Build, nachdem ein Headerfile geändert wurde.
    Das verwundert nicht, weil warp eine Art Ramdisk mit etwas Caching ist. Man darf nicht vergessen, dass Facebook eine Build-Infrastruktur mit langsamen Datei-Zugriff und so hat und die memcache-Lösung sich nach ziemlichem Gefrickel anhört. Dazu kommt noch, dass Facebook anscheinend viele Makros hat, ich verwende den Präprozessor quasi nur für includes und include guards (warp erkennt die automatisch!!!1!11), von daher erwarte ich davon keinen Speedup für meine Zwecke.


Anmelden zum Antworten