-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Bullet gem in development mode #9943
Comments
Hey Jeff! What do you think about this @jywarren? Let me know ✌️ |
This is a pretty good suggestion! My college uses rails for our UIMS, and bullet has helped a lot in dev, especially for N+1 queries. I definitely think this should be there |
This looks really nice! How would such issues be presented/displayed, like what would be an example, and how might we encourage people to read them and generate issues from them? Could we have a "support" issue for combing through these? Also, would it block anything? I guess if it's integrated into tests, it might, but not otherwise? |
So, as far as I understand, bullet doesn't play any part in tests. it's used just during the development cycle, and not in tests. Bullet actually displays errors as a pop-up JS alert when the page with inefficient queries is loaded. Along with that, there is a more descriptive hovering footer kind of section, that displays which query is causing the error, and if there are any quick fixes to it. Usually, the fixes that are specified are good enough. People coming across these errors can make issues and FTOs from it. It'll help make the code cleaner, and also help drive community involvement! |
Bullet can be set into 'raise exceptions' mode where tests will fail on N+1 issues. It can be very difficult to make all the scenarios pass though - and sometimes you have to accept occasional over-eager loads depending on what the view ends up doing |
Please describe the desired behavior.
Given the performance issues we have been facing lately, was thinking of adding Bullet gem in the development mode and necessary config. We can then add some documentation to suggest contributors to check their added queries and whether they are performant or not before opening a pull request. There is also a possibility of adding bullet in tests but will have to check out how it exactly works.
Bullet gem will flag issues such as N+1, unnecessary eager loading etc. through log/bullet.log file, browser console and as a js alert on the page.
https://github.com/flyerhzm/bullet
The text was updated successfully, but these errors were encountered: