split out byte_generation and zipfile writing for profiler