The old code was calling "lookup_student_id" twice in rapid succession, each time hitting the uncached DB query.