PoignardAzur/venial

Split functions behind feature-gate.

Closed this issue · 1 comments

The main design goal of Venial is to provide a proc-macro parser with minimal build time, primarily for derive macros.

Derive macros only need to consider three syntax elements: structs, enums, and unions. There should be a feature flag so that users who only need these don't pay the build time price of all the other features.

(Or maybe not. The first thing we should do is measure how much time these features actually add.)

Alright, I ran some tests, using this fork of miniserde I wrote a while ago to test venial.

In a test project with miniserde-venial as a dependency, I got the following build times:

  • 4.0s for the original using syn.
  • 2.7s using venial 0.2.1.
  • 2.9s using venial 0.6.

These differences were with a moderately powerful thinkpad laptop, eg not with a desktop computer or a macbook. I'm pretty sure the difference becomes invisible with one of those.

Overall, I don't think it's worth going through the pain of adding feature gates. I'm closing this.