inlined pmap logic in compiled writer for speedup.