guides

Scheduled Compilation

Set up cron jobs and scheduled tasks to pre-compile workloads.

Published May 30, 2026

Cron Job Example

# Compile hot functions every night at 2 AM
0 2 * * * cd /app && pyvorin compile main.py --function process_data

# Warm cache on reboot
@reboot cd /app && pyvorin run main.py --function process_data

Systemd Timer

# /etc/systemd/system/pyvorin-warmup.service
[Unit]
Description=Pyvorin Warm-up

[Service]
Type=oneshot
ExecStart=/usr/local/bin/pyvorin run /app/main.py --function process_data
User=app

# /etc/systemd/system/pyvorin-warmup.timer
[Unit]
Description=Run Pyvorin warm-up hourly

[Timer]
OnCalendar=hourly
Persistent=true

[Install]
WantedBy=timers.target

Pre-Compilation in CI

Compile all entry points during the build phase so production starts with a warm cache:

for func in process_data aggregate_report send_alerts; do
    pyvorin compile main.py --function $func
done