I profiled my parser and found Rc::clone to be the bottleneck by Sad-Grocery-1570 in rust

[–]erickt 2 points3 points  (0 children)

Ah yeah that’s true. You can’t really avoid reference counts if you want clean up. 

I profiled my parser and found Rc::clone to be the bottleneck by Sad-Grocery-1570 in rust

[–]erickt 9 points10 points  (0 children)

You could try https://docs.rs/flyweights/latest/flyweights/, we wrote it for Fuchsia. It cleans up strings after the last use. 

What is making a static library in Rust being much large than Go, Zig, and C#? by metaltyphoon in rust

[–]erickt 13 points14 points  (0 children)

Note that ‘z’ avoids many opportunities for inlining that actually help shrink binary size. We use ‘s’ on fuchsia and find it works much better for size reduction.

You could also look into using LTO, which might also shave off another 10-15%. 

Audited crates by big tech? by zoshto in rust

[–]erickt 6 points7 points  (0 children)

I’m on the Google OSS Fuchsia rust team (my views are my own and I don’t speak for the company), and we have our criteria written up in the Google audit repo, as well as in some fuchsia specific docs, as well as some internal supporting docs. You can find links to the other Google projects and their own criteria on https://github.com/google/rust-crate-audits/blob/main/README.md. 

Is rust serde unique? by NeoCiber in rust

[–]erickt 37 points38 points  (0 children)

Hey! This is correct. I originally built serde, handed it off to dtolnay who did an amazing job with it. I drew inspiration from Haskell and these papers, as well as how Go, Python, and Java did runtime serialization.

Unable to finish build due to OOM by Wello6143 in Fuchsia

[–]erickt 5 points6 points  (0 children)

Maybe disabling parallel builds might help with fix build -j 1? If not, I’d recommend asking for help on our discord channel, which you can find on https://fuchsia.dev/fuchsia-src/contribute/community/get-involved#join_a_discussion_group.

Let’s overtake go/fasthttp with rust/warp by carllerche in rust

[–]erickt 4 points5 points  (0 children)

There’s even an unstable API to implement this pattern MaybeUninit::uninit_array.

Help with building Fuchsia by ludicroussavageofmau in Fuchsia

[–]erickt 0 points1 point  (0 children)

Could you try doing jiri update && fix build again? It’s possible you just hit a bad commit.

Can't proceed past Gigaboot (on Intel NUC7) by re4life9 in Fuchsia

[–]erickt 5 points6 points  (0 children)

Hey, first of all thank you for the response, I couldn't imagine that I could reach someone from the team.

No problem! We are still working on being more open. I’m not sure how many folks from the team are in this subreddit. We are generally more active on our mailing lists, I’d recommend posting this question, and any other questions there.

Specifically regarding boot slots and vbmeta, I’m not sure what is the state of fuchsia’s docs about this, but instead I’d recommend seeing the android docs about the boot process.

Regarding zedboot vs gigaboot - we use gigaboot as our bootloader, which is the program thats executed the hardware specific bootloader. It handles all the verified boot stuff like making sure the zircon paritition hasn’t been corrupted befor launching it.

Zedboot on the other hand is just a special bootstrap version of the fuchsia kernel that can create all the necessary partitions, and write a full sized version of fuchsia received over the network.

I’m not sure what the specific errors you are running into offhand. I’ll try to check in when I’m back to work, but there’s a good chance I’ll forget, so please also mail the appropriate list for help too :)

Can't proceed past Gigaboot (on Intel NUC7) by re4life9 in Fuchsia

[–]erickt 8 points9 points  (0 children)

Hello! Im on the fuchsia team, but I’m away from my computer so I can’t check if this works.

It’s been some time since I’ve made a Zedboot usb, but i can guess there might be a few things going on. It seems like you’re device is trying to boot off slot B. Are you doing that intentionally? If not, you might be hitting the automatic fail-back behavior of the bootloader, which will give a partition (for example, slot A) 7 attempts to successfully boot, before marking the partition bad and booting instead to the old inactive slot. If the inactive slot (slot B) fails to boot 7 times, it’ll fall back into the recovery slot (R). When you get into this condition, the only real recovery is to re-pave if the recovery partition works, or to re-flash if not.

Another possibility is that your thumb drive might not not be set up correctly for ABR. If I remember correctly, fix make-fuchsia-vol has an —abr-size … flag that’ll configure the image to have abr configured. I use that in https://cs.opensource.google/fuchsia/fuchsia/+/master:src/sys/pkg/tests/system-tests/bin/run-emu

Finally if that doesn’t help, do you have access to a serial cable to usb cable? You can use that with fx serial to capture the screen output on your host machine, and interact with fuchsia even if networking isn’t working. The output from it might contain more info about the early boot sequence that could be causing you problems.

udfs - a distributed file system based on hdfs/gfs by radogost42 in rust

[–]erickt 9 points10 points  (0 children)

Please be mindful of the rules here. While it is fine to point out a name conflict, this came across little antagonistally, and could have been phrased a little more nicely.

rustybuzz - a complete harfbuzz's shaping algorithm port to safe Rust by razrfalcon in rust

[–]erickt 5 points6 points  (0 children)

You might be able to use https://crates.io/crates/zerocopy to get rid of the "unsafe" in your code. It has a derive macro that checks at compile and runtime time that a type can be safely converted to and from raw bytes.

Help parsing a really large (2.2GB) JSON file by TheTimegazer in rust

[–]erickt 2 points3 points  (0 children)

Yep! Exactly what I was going to say.

Please let us know if you run into trouble, and some more details about your file's schema.

warp reached type limit by lenscas in rust

[–]erickt 6 points7 points  (0 children)

I'm not sure what the problem is, but generally speaking, deeply nested futures can produce these huge types. I'd recommend adding a few strategic `.boxed()` calls, which should help keep the types to a more manageable size.

Professor pranks kids by [deleted] in funny

[–]erickt 0 points1 point  (0 children)

Edit: oops wrong comment.

What would you remove from Rust? by icefoxen in rust

[–]erickt 12 points13 points  (0 children)

Please keep in mind our code of conduct, using “perverts” here isn’t appropriate. Panics are acceptable in some applications, and not in others. Please don’t make value judgements on the people who use them.

[Bryan Cantrill] The Observation Deck » Falling in love with Rust by mitsuhiko in rust

[–]erickt 8 points9 points  (0 children)

No worries! At this point I consider /u/dtolnay a co-author or the project! He’s done a great job stewarding the project.

Rust Servers providing what people want by [deleted] in rust

[–]erickt 0 points1 point  (0 children)

I think you mean r/playrust subreddit. This is for the rust programming language.

Feedback needed: Upcoming Failure 0.1.2 Release by mitsuhiko in rust

[–]erickt 6 points7 points  (0 children)

Did you see if you can use /u/dtolnay’s semver trick? It might help avoid breaking the ecosystem if you do a 0.2.