-
Notifications
You must be signed in to change notification settings - Fork 722
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Consider switching from pin-project to pin-project-lite #1178
Comments
Sorry for the delay in responding. I'm somewhat inclined to avoid making this switch, as I think we'll be taking a dependency on |
In the benchmark from the PR I linked to, pin-project-internal + pin-project take 1.42s to compile independently from syn & quote. pin-project-lite takes 0.2s to compile in the same benchmark. Considering how little tracing is using pin-project / how easy it was to switch, this seems desireable even without being able to remove syn & quote from the dependencies. |
My bad, I didn't look closely enough. That's a compelling argument in favor of this change, then. |
I disagree with this. "It takes N seconds independently" is not always a problem (parallel compile handles it well). See this comment that linked in the PR you linked to.
|
You're right but with tokio already using pin-project-lite and futures-rs having switched recently, it's almost impossible to not depend on pin-project-lite in an app that uses async/.await. I'd prefer if there wasn't multiple dependencies that do the same thing in my dependency graph, that's why I'm sending these patches. Further, while parallelization might mean that using pin-project instead of pin-project-lite in tracing doesn't improve compile times for tracing itself, it may improve compile times for dependent crates with a larger dependency graph, such that parallelization is already being used maximally for a large part of the build process. And there's also the issue of power consumption, and CPU throttling that can worsen compile times even if additional work is done fully on an otherwise unused core. All-in-all I don't see why tracing should not switch, considering it's so simple (PR is up at #1185, diffstat +52 −33). |
That's true, but it's basically only if consider the compile time in a single clean build. (And its impact should actually be small enough.) FYI, I already explained this in the comment linked in the previous comment:
In the same comment, I said my opinion on this:
To be honest, I'm not strongly against doing this in |
Okay, I see where you're coming from. Let's see what the maintainers think. I still think even though it's just fresh compiles this still makes somewhat of a difference when frequently switching between toolchains, frequently updating due to being on Nightly, and for CI. But you're right that in most circumstances it's not so much of a problem. Also with you having written and maintaining both crates, there is no additional supply chain attack vector when using both – if anything, I would consider pin-project-lite to be harder to review due to being |
Yeah, pin-project is definitely more robust than pin-project-lite. (Especially in parsing, pin-project-lite needs to do everything itself, and actually, most of pin-project-lite's known limitations/bugs are about parsing. By the way, for the code generation, there are tests to track changes in the generated code in both crates, so basically there is no problem.) |
Feature Request
Crates
tracing-futures
Motivation
pin-project-lite, in contrast to pin-project, does not depend on syn and quote and as such is much lighter on compile times. futures-rs switched recently, see that PR for compile time differences.
Proposal
Switch from pin-project to pin-project-lite.
Alternatives
Do nothing. Other things (hyper, async-tungestenite, ...) are still pulling in pin-project so it will rarely make a difference to end users (now at least).
The text was updated successfully, but these errors were encountered: