Brad Fitzpatrick (brad) wrote,
Brad Fitzpatrick
brad

.. more livejournal speed-ups

One of my favorite ways to optimize database applications is to enable db logging and then just tail the log file and watch how many unecessary queries are happening, then go try and clean them up. for instance: I noticed that if you were logged in and went to look at your own journal, it would pull your user record twice from the database: once to render the page, which is always necessary, but then also once to verify your login password with your login username ... I rearranged a bunch of code and now it pulls the full page owner's user record first (before it was doing remote user authentication first) so then when it comes time to authenticate the user, I can check and see if the remote user is the page owner, and thus prevent an extra query.
Subscribe
  • Post a new comment

    Error

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

    When you submit the form an invisible reCAPTCHA check will be performed.
    You must follow the Privacy Policy and Google Terms of use.
  • 2 comments