Skip to content
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

Dependency Reduction? #2861

Closed
AldaronLau opened this issue Jul 8, 2022 · 3 comments
Closed

Dependency Reduction? #2861

AldaronLau opened this issue Jul 8, 2022 · 3 comments

Comments

@AldaronLau
Copy link
Contributor

I was looking at cargo tree and wondering if there's places for improvement in reducing dependencies. I came up with the following things:

  • I'm wondering if it's possible to make raw-window-handle an optional dependency (say if the programmer doesn't need a window).
  • Dependencies naga and codespan-reporting always pull in termcolor, which should be unnecessary
  • The smallvec and arrayvec dependencies do almost the same thing, could possibly use tinyvec for both use cases
  • The profiling crate could also be optional

I don't know if all of these are a good idea, but I'd be willing to work on any of them.

@kpreid
Copy link
Contributor

kpreid commented Jul 9, 2022

These two are probably only relevant if wanting to remove dependency count rather than size:

  • raw-window-handle is very lightweight since it only provides types (that contain *mut c_void pointers for the most part).
  • profiling only depends on profiling backends requested by features — its purpose is essentially to be the mechanism by which profiling instrumentation is conditionally compiled.

@cwfitzgerald
Copy link
Member

Smallvec is a much more complicated bit of kit - it has non-zero overhead over a Vec/ArrayVec, so it's a specialized tool that we need in certain situations.

@teoxoy
Copy link
Member

teoxoy commented Feb 22, 2023

codespan-reporting (used in wgpu to display naga's validation errors) depends on termcolor, so making naga's usage of termcolor optional won't change wgpu's tree.

I double checked wgpu's tree and it seems besides #3502 there aren't other opportunities to remove other dependencies.

I think we can close this for now.

@teoxoy teoxoy closed this as not planned Won't fix, can't repro, duplicate, stale Feb 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants