Brad Fitzpatrick (brad) wrote,
Brad Fitzpatrick

.. 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.

  • Ukraine

    Nobody reads my LiveJournal anymore, but thank you to everybody in Russia protesting Putin's insane war against Ukraine. (I know it's risky…

  • Happy Birthday!

    Happy 20th Birthday, LiveJournal! 🐐🎂🎉

  • hi

    Posting from the iPhone app. Maybe I'm unblocked now.

  • Post a new comment


    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.