Caching by FBtoC's build system
During compilation, FBtoC caches data in the source directory's build_temp folder. Reusing this data in subsequent builds allows some steps of compilation to be skipped. Builds subsequent to the first one are therefore faster. The caches affect the compilation phase only, not translation.
The caches are maintained as files in build_temp. If build_temp or its files are missing, FBtoC regenerates them. If you change certain critical FBtoC compilation settings, FBtoC invalidates the cached information, and regenerates it automatically during the next build.
FBtoC maintains two kinds of cached information.
Precompiled FB runtime code
The compiled runtime is the file build_temp/_0_TranslatedRuntime.o
Header information from the OS X frameworks
Also known as a precompiled header, or pch.
Controlled by FBtoC settiings 'Use precompiled header'.
The cache, in a format private to gcc, is the file build_temp/FBtoC_Prefix.h.gch
A pch is architecture-specific. FBtoC therefore disables it for a Universal build:
¿¿ Warning: Precompiled header disabled for universal architecture
A pch is most effective when you do repeated builds for a single architecture and with the same FBtoC settings. This is typically the case during program development, for which fast compilation is especially desirable. The recommended development settings are shown below:
If, on the other hand, you are experimenting with different settings, the pch may have to be recompiled after every change. In this circumstance, turning off the pch is likely to improve turnaround times.
The relevant FBtoC settings are:
Walkthrough
In the Finder, locate a smallish FB source file.
Trash its build_temp folder, if present, thereby removing all cached information.
In FBtoC's Settings dialog, click 'Set all to defaults', thereby turning the 'Use precompiled header' checkbox off.
Click OK to dismiss the dialog.
Open the source file with FBtoC. You should see something like:
FBtoC: translating project Demo.bas to Demo.c FBtoC: translation time: 0.20 s FBtoC: copying files FBtoC: copy time: 0.05 s FBtoC: compiling Demo.c to Demo.app FBtoC: compiling runtime [create _0_TranslatedRuntime.o] FBtoC: compiling user code FBToC: compile+link time: 2.21 s FBtoC: total time: 2.49 s FBtoC: launching Demo.app FBtoC: done
In FBtoC, open the same file again, or type Command=
Compilation is faster.
FBtoC: translating project Demo.bas to Demo.c FBtoC: translation time: 0.21 s FBtoC: copying files FBtoC: copy time: 0.06 s FBtoC: compiling Demo.c to Demo.app FBtoC: using precompiled runtime [save some time] FBtoC: compiling user code FBToC: compile+link time: 0.85 s FBtoC: total time: 1.13 s FBtoC: launching Demo.app FBtoC: done
Turn the 'Use precompiled header' checkbox on in FBtoC prefs, then type Command=
Compilation is slowed by the time for gcc to build the pch cache.
FBtoC: translating project Demo.bas to Demo.c FBtoC: translation time: 0.20 s FBtoC: copying files FBtoC: copy time: 0.05 s FBtoC: creating precompiled header [create FBtoC_Prefix.h.gch] FBtoC: using precompiled header FBtoC: pch time: 3.18 s FBtoC: compiling Demo.c to Demo.app FBtoC: using precompiled runtime FBtoC: compiling user code FBToC: compile+link time: 0.28 s FBtoC: total time: 3.76 s FBtoC: launching Demo.app FBtoC: done
Type Command=, and note that we now reap the full benefit of caching:
FBtoC: translating project Demo.bas to Demo.c FBtoC: translation time: 0.20 s FBtoC: copying files FBtoC: copy time: 0.06 s FBtoC: using precompiled header [save more time] FBtoC: compiling Demo.c to Demo.app FBtoC: using precompiled runtime FBtoC: compiling user code FBToC: compile+link time: 0.25 s FBtoC: total time: 0.52 s FBtoC: launching Demo.app FBtoC: done