rust-lang / rls

Repository for the Rust Language Server (aka RLS)
Other
3.51k stars 258 forks source link

Large save-analysis for glium and nalgebra #1092

Open ElusiveMori opened 5 years ago

ElusiveMori commented 5 years ago

I've read through the troubleshooting guide, and it suggests to report crates with a save-analysis file of over 1 MB. I decided to check just in case, and I found that https://github.com/glium/glium and https://github.com/rustsim/nalgebra have rather large footprints, at 10MB and 2MB respectively.

image

This is on latest nightly (just updated today).

I don't think it's an issue (at least not for me, right now), but I thought I'd report it anyway. Cheers.

nrc commented 5 years ago

We should probably blacklist glium. nalgebra is borderline, and I don't see why it blows up so big

nrc commented 5 years ago

To be clear, I mean that we should investigate teh nalgebra analysis

jens1o commented 5 years ago

We should probably blacklist glium.

You mean like refuse to cache it and always index from scratch?

nrc commented 5 years ago

You mean like refuse to cache it and always index from scratch?

It would mean not indexing it at all. That could be overridden by the user, of course.

waynr commented 5 years ago

@nrc I'm about to open a PR against https://github.com/rust-dev-tools/rls-blacklist to add glium to the blacklist, but I'm wondering why that list isn't just in this git repo? Would it make sense to move it here?

nrc commented 5 years ago

I'm wondering why that list isn't just in this git repo? Would it make sense to move it here?

It's used by other tools too.

waynr commented 5 years ago

Ah, I guess that makes sense. I was actually just about to suggest that it might be a good idea to make the blacklist configurable by either allowing users to add to it or override it entirely through their editor, although come to think of it i'm not even sure how how configuration is passed from the client to the server.

As far as investigating the nalgebra analysis is concerned, is that something you think a newbie like myself could do? How would I start and what would I look for?

nrc commented 5 years ago

As far as investigating the nalgebra analysis is concerned, is that something you think a newbie like myself could do? How would I start and what would I look for?

Maybe. Certainly the initial investigation is very do-able, and what that turns up will indicate how difficult fixing it will be.

The first thing I'd do is get the JSON data and get some idea of what is using the space - refs or defs (or something else) and maybe some more detail. Then compare to the source code - see if anything looks wrong (vs just a lot of input) and if there is anything which looks like it could be trimmed out.

korrat commented 4 years ago

Is this still relevant? If so I'd like to take a look at this.