Closed misalcedo closed 3 years ago
Need to learn how to pass a dynamic output to the emit function in emit_section.
The counting emitter worked, but I had to remove the implicit Sized bound on most emit functions, though not all. The section ones still require a sized bound for now.
The benchmarks were inconclusive for the module buffer, but seemed to show improvements when removing the function buffer. I think the bigger win here is not having to determine a pre-allocation size for buffers. For larger modules this may prove beneficial as setting an initial capacity was the best perf improvement.
The section emitters need to be marked as sized in order for the emit_section to be able to cast O to dyn Write.
Benchmark the differences between writing to a buffer, then copying, vs. counting then writing again for emitting to binary.