Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Rails usage of jit_stub primitives #1991
I thought it would be useful to know which primitives JIT doesn't know about (jit_stubs) get called fairly frequently by Rails in order to work on jitting the most frequently called ones first.
The repro is quite simple:
The rails app is a simple Movie CRUD db, the code is here https://github.com/hosiawak/hw3_rottenpotatoes but I think it could be any other typical rails app.
Then we generate some call frequency stats:
If you find this data useful - great, if not feel free to close this issue :)
@hosiawak this is great, thank you for doing some investigation! This is an area that @evanphx and I have spoken about a few times. Just calling to the jit_stub does defeat some of the optimizations that we expect the JIT to be able to do, so we do want to emit LLVM IR for some cases. There are two challenges here: 1) we need to be able to test the JIT better, 2) we want to avoid diminishing returns.
Any sophisticated JIT (any program literally) will have a tradeoff between runtime and memory. We need to ensure that we are not skewing that too badly. Also, just emitting more machine code isn't the best way to improve performance.
So, the next step is to determine higher level patterns that we want to optimize and then look at whether hand-crafting output for select jit_stub functions gets us the improvements we want.