PoignardAzur / venial

"A very small syn"
MIT License
196 stars 7 forks source link

Split functions behind feature-gate. #40

Closed PoignardAzur closed 10 months ago

PoignardAzur commented 2 years ago

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.)

PoignardAzur commented 10 months ago

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:

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.