Comments (6)
I pushed 224db41 recently that makes a big dent in the problem! The issue is related to private type aliases of public types. Making the type alias public cuts a clean build with --all-features
from 1137.24 s down to 28.68 s on one of my machines! A build with default features goes from 25.94 s to 5.73 s.
I did eventually get cargo bloat
running after some technical delays and and the results seem to show that uom, at least for the si
example, is fully inlined: https://gist.github.com/iliekturtles/474e950b544c268d3c600567f0f60bd8.
I'm leaving the issue open for the moment as I want to submit a report upstream.
from uom.
Initial investigation shows that the storage_types!
calls in quantity!
that add $crate::Conversion<V>
and super::Conversion<V>
impl blocks are the culprit. Commenting out these impls makes compilation significantly faster.
from uom.
I'm pretty sure macro recursion isn't the issue, but reviewing the output of cargo bloat
is a good idea!
from uom.
(Hi from the 'what are you up to this week' thread)
Maybe this blogpost about clap
s weight-reduction can help?
https://clap.rs/2018/01/09/new-years-weight-loss/ (sorry, the title sounds a bit spammy)
This uses the excellent cargo bloat
), which helped kbknapp see where his macros where unexpectedly recursing, and some refactoring brought down the total code size (and thus, compile time).
Admittedly, the blog is mostly about binary size, but on the assumption that "more generated code == more compile time", it might pay to have a look.
from uom.
Yeah, from the issue description, and the mostly linear time relation with the number of enabled features (excellent benchmark, b.t.w.), it's probably just the linear amount of complex implementations.
But who knows, maybe bloat
can help you identify some potential optimisations in those traits. :-)
from uom.
Closing this issue. Upstream issue triaged and current uom
compile times are reasonable.
from uom.
Related Issues (20)
- Subtracting thermodynamic temperatures should produce a temperature interval HOT 5
- Suggestion: Using const generics to express quantities info HOT 9
- error[E0277]: the trait bound `<<D as si::Dimension>::L as std::ops::Neg>::Output: Integer` is not satisfied HOT 2
- Request: FrequencyShift HOT 2
- Support defmt framework HOT 3
- Bump MSRV HOT 3
- Support new SI prefixes
- How to use a base unit that's not predefined? HOT 4
- parse a unit type from a string HOT 4
- [Bug] Test failure for default feature on armel arch HOT 17
- Add newton_per_square_millimeter in Pressure HOT 2
- serde support broken ? HOT 2
- Computing an average temperature HOT 5
- Missing implementation of product for Ratio HOT 1
- Add `decimal` support HOT 1
- Functor / map HOT 2
- add thermal_capacitance [J/K] HOT 1
- Implement Pace quantity
- Can't parse units added to existing quantities HOT 1
- Conversion factor doc inconsistency HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from uom.