Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Possible perf improvements. #59

Open
emilio opened this issue Sep 21, 2016 · 3 comments
Open

Possible perf improvements. #59

emilio opened this issue Sep 21, 2016 · 3 comments

Comments

@emilio
Copy link
Contributor

emilio commented Sep 21, 2016

Just a few I'm thinking about off the top of my head, just in case someone wants to get to them.

  • Reuse builtin types indexed by constness.
  • Use fnv.
  • Parallelize codegen? (Should be easy-ish using rayon).
@fitzgen
Copy link
Member

fitzgen commented Oct 24, 2016

Before we do any of this, we should have some #[bench]s so we can actually determine whether any given change is a win or not.

@fitzgen
Copy link
Member

fitzgen commented Apr 7, 2017

I think we should just uses the preprocessed stylo headers for benchmarking, eg https://gist.github.com/fitzgen/51962fef1a2cdb8fe874d94a5d22387a

We shouldn't try and assert that there is no diff between versions like our normal tests because its just way too big for diffs not to get introduced one way or another. Just a sanity test that it successfully builds + a bench timing how long it takes.

Depends on #584 first, so we can successfully process stylo headers again.

This would have the nice side benefit that stylo bindings would break because of bindgen master changes less often.

@fitzgen
Copy link
Member

fitzgen commented Aug 14, 2017

Ok, so I just went down a rabbit hole of trying to get rayon to run each of our analyses as its own fork-join task. The problem is that BindgenContext is not Sync because it has all these libclang FFI types in it (plus other things like Cell, but those are easy enough to stuff into a Mutex or whatever). Even BindgenOptions is not Sync for similar reasons. Also the syntex ExtCntxt thing is not Sync.

I tried splitting various non-Sync pieces of BindgenContext into a ParseContext and a CodegenContext depending on where they ended up used, but it is pretty hard to disentangle these bits.

Here is my WIP commit for posterity: fitzgen@5dbf850

I don't intend on continuing this work for the time being.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants