Replies: 9 comments 15 replies
-
I will say as well, looking at the output of
Obviously we can expect the runtime performance of |
Beta Was this translation helpful? Give feedback.
-
Had some more digging today, this time using
Sorting by time taken: > sort -nk 2 times.txt | tail -11 # top 10 plus total
time: 9.472; rss: 51MB -> 598MB ( +547MB) expand_crate
time: 9.472; rss: 51MB -> 598MB ( +547MB) macro_expand_crate
time: 10.330; rss: 1637MB -> 1969MB ( +332MB) generate_crate_metadata
time: 10.460; rss: 51MB -> 822MB ( +771MB) configure_and_expand
time: 11.072; rss: 1151MB -> 1551MB ( +401MB) MIR_borrow_checking
time: 12.394; rss: 1186MB -> 1140MB ( -45MB) item_bodies_checking
time: 16.134; rss: 1096MB -> 1142MB ( +46MB) type_check_crate
time: 23.106; rss: 2091MB -> 2232MB ( +141MB) LLVM_passes(crate)
time: 24.867; rss: 1963MB -> 2229MB ( +266MB) codegen_to_LLVM_IR
time: 24.976; rss: 1969MB -> 2229MB ( +259MB) codegen_crate
time: 80.185; rss: 40MB -> 165MB ( +125MB) total Interestingly, we peak at over 2GB of RAM when compiling as well. |
Beta Was this translation helpful? Give feedback.
-
Just to add some more to the above: #[derive(serde::Deserialize, serde::Serialize)]
pub struct Discount {
// Always true for a deleted object
#[serde(default)]
pub deleted: bool,
/// The subscription that this coupon is applied to, if it is applied to a particular subscription.
#[serde(skip_serializing_if = "Option::is_none")]
pub subscription: Option<String>,
}
fn main() {}
Switching over to Based on the above findings and this, we can see that serde is producing almost all of the bloat in the crate. One solution we've discussed is simply splitting the crate into multiple crates based on the existing feature gates, eg ( |
Beta Was this translation helpful? Give feedback.
-
In light of this recent PR on serde, I thought it would be interesting to compare with the old results. The below was done with Therefore we are seeing near enough 1 million lines of serde generated code. The below was done with a patch of (serde)[https://github.com/nnethercote/serde/commit/f8cc37c8547589edb88123424b55cce19a5feaaf] from the PR: Delta of |
Beta Was this translation helpful? Give feedback.
-
Please don't take this as criticism, just as a data point. We are pulling |
Beta Was this translation helpful? Give feedback.
-
As a user of this crate, should I expect turning off unused features to significantly reduce compile times? |
Beta Was this translation helpful? Give feedback.
-
Hey folks, some lovely numbers from the rewrite (currently hiding in the
It is not ready for production but we are getting close to an RC |
Beta Was this translation helpful? Give feedback.
-
Wow, that's awesome Alexander. Thank you so much for the work on this! |
Beta Was this translation helpful? Give feedback.
-
Not an expert on rust at all, but searching around came across this discussion. Compiling this on a t2.small doesn't work, it doesn't work also in t2.media (about 4 GB ) or ram. It just eats the RAM pretty quick until the computer becomes unresponsive, you can see with htop in ubuntu that it builds up in a few seconds and reaches the 4 gigs You have to stop the EC2 instance manually from AWS, and run again. It sounds that it might be just better for now not to use this crate ? and use an HTTP client and talk to Stripe API directly for the use-cases of each app. Not sure if this is helpful:
|
Beta Was this translation helpful? Give feedback.
-
It's no secret that this library has quite terrible compile perf:
Here is some data, based on the benchmark project (which still uses the blocking runtime):
Clearly, from this, serde is vastly increasing the size of the code, and is likely the primary culprit. Solutions?
Beta Was this translation helpful? Give feedback.
All reactions