Conrad Irwin
๐ค SpeakerAppearances Over Time
Podcast Appearances
Yeah. So the primary input to the create structure is compile time because 500,000 lines of Rust takes a long time to compile. And so really the question is, what code gets recompiled a lot, and how do we reduce the amount of it? And so that's where the create structure comes from.
Yeah. So the primary input to the create structure is compile time because 500,000 lines of Rust takes a long time to compile. And so really the question is, what code gets recompiled a lot, and how do we reduce the amount of it? And so that's where the create structure comes from.
This is obviously a little bit around abstractions and not leaking between things, but really primarily it's the speed thing. So we don't really want a kind of a deeply nested thing where visibility is tightly controlled and we have lots of, you know, that's not important. We trust the whole code base. And so it's making sure that it's somewhat easy to find what you're looking for.
This is obviously a little bit around abstractions and not leaking between things, but really primarily it's the speed thing. So we don't really want a kind of a deeply nested thing where visibility is tightly controlled and we have lots of, you know, that's not important. We trust the whole code base. And so it's making sure that it's somewhat easy to find what you're looking for.
This is obviously a little bit around abstractions and not leaking between things, but really primarily it's the speed thing. So we don't really want a kind of a deeply nested thing where visibility is tightly controlled and we have lots of, you know, that's not important. We trust the whole code base. And so it's making sure that it's somewhat easy to find what you're looking for.
And when you rebuild, you know, if you make a change to the editor, you don't have to rebuild too much else of the code base to get into testing.
And when you rebuild, you know, if you make a change to the editor, you don't have to rebuild too much else of the code base to get into testing.
And when you rebuild, you know, if you make a change to the editor, you don't have to rebuild too much else of the code base to get into testing.
Right. Yeah, and I like the pragmatism there. We do have some crates that are too big, but mostly it's pretty well factored out, I think.
Right. Yeah, and I like the pragmatism there. We do have some crates that are too big, but mostly it's pretty well factored out, I think.
Right. Yeah, and I like the pragmatism there. We do have some crates that are too big, but mostly it's pretty well factored out, I think.
So one thing I learned, we did a rewrite of GPUI, the graphics framework, that was fairly heavy on use of generics and ended up exporting a bunch of things that were instantiated multiple times with multiple different types. And the way that Rust compiles generics is to kind of copy-paste the code each time for each type.
So one thing I learned, we did a rewrite of GPUI, the graphics framework, that was fairly heavy on use of generics and ended up exporting a bunch of things that were instantiated multiple times with multiple different types. And the way that Rust compiles generics is to kind of copy-paste the code each time for each type.
So one thing I learned, we did a rewrite of GPUI, the graphics framework, that was fairly heavy on use of generics and ended up exporting a bunch of things that were instantiated multiple times with multiple different types. And the way that Rust compiles generics is to kind of copy-paste the code each time for each type.
And so we had some kind of big compile time regressions at that point just because of the way the code was structured. And so one thing to look out for is as often as you can avoid having a generic type exported from a crate.
And so we had some kind of big compile time regressions at that point just because of the way the code was structured. And so one thing to look out for is as often as you can avoid having a generic type exported from a crate.
And so we had some kind of big compile time regressions at that point just because of the way the code was structured. And so one thing to look out for is as often as you can avoid having a generic type exported from a crate.
So if you have a function that takes generic arguments, you kind of want to keep that internal because otherwise every time someone uses it, you get another copy of that whole thing out. And obviously, like everything, there's a trade-off. There are some things where it is worth the pain, but there are other things where if you can avoid that kind of type boilerplate exploding, you should.
So if you have a function that takes generic arguments, you kind of want to keep that internal because otherwise every time someone uses it, you get another copy of that whole thing out. And obviously, like everything, there's a trade-off. There are some things where it is worth the pain, but there are other things where if you can avoid that kind of type boilerplate exploding, you should.
So if you have a function that takes generic arguments, you kind of want to keep that internal because otherwise every time someone uses it, you get another copy of that whole thing out. And obviously, like everything, there's a trade-off. There are some things where it is worth the pain, but there are other things where if you can avoid that kind of type boilerplate exploding, you should.