Assuming that there is memory to spare, caching all, or part of Firefox's profile to RAM using tmpfs offers significant advantages. Even though opting for the partial route is an improvement by itself, the latter can make Firefox even more responsive compared to its stock configuration. Benefits include, among others:

many operations within Firefox, such as quick search and history queries, are nearly instantaneous

Both of previously mentioned options make use of native shared memory; /dev/shm, a directory that behaves just as ordinary mounted file systems do, only with the notable exception that all of its content is stored in RAM.

The script

The script will first move Firefox's profile to a new static location, make a sub-directory in Template:Filename, softlink to it and later populate it with the contents of the profile. As before, replace the bold sections to suit. The only value that absolutely needs to be altered is, again, Template:Codeline.

The script also provides a firefox wrapper Template:Codeline, which runs Template:Codeline before and after Template:Codeline. This is an alternative to syncing with cron, or on login/logout (described below). Be careful with the "Restart Firefox" button within firefox, though, since this might not start the wrapper.

Automation

Seeing that forgetting to sync the profile can lead to disastrous results, automating the process seems like a logical course of action.