1. 23 Feb, 2017 2 commits
    • Student Dashboard CourseOverviews with one query. · 8423ecb1
      Pre-load the course overviews attached to CourseEnrollments on the
      Student Dashboard, if possible. This will only grab the CourseOverviews
      that already exist, and will not generate new ones. Any missing
      CourseOverviews fall back to the lazily-created one-at-a-time behavior
      they've always had. That's mostly because I wanted to optimize for the
      common case in the least invasive way possible, and I don't want to get
      caught up in locking issues.
      David Ormsbee committed
    • Test Speedup: Isolate Modulestore Signals · 2051c909
      There are a number of Django Signals that are on the modulestore's
      SignalHandler class, such as SignalHandler.course_published. These
      signals can trigger very expensive processes to occur, such as course
      overview or block structures generation. Most of the time, the test
      author doesn't care about these side-effects.
      
      This commit does a few things:
      
      * Converts the signals on SignalHandler to be instances of a new
        SwitchedSignal class, that allows signal sending to be disabled.
      
      * Creates a SignalIsolationMixin helper similar in spirit to the
        CacheIsolationMixin, and adds it to the ModuleStoreIsolationMixin
        (and thus to ModuleStoreTestCase and SharedModuleStoreTestCase).
      
      * Converts our various tests to use this new mechanism. In some cases,
        this means adjusting query counts downwards because they no longer
        have to account for publishing listener actions.
      
      Modulestore generated signals are now muted by default during test runs.
      Calls to send() them will result in no-ops. You can choose to enable
      specific signals for a given subclass of ModuleStoreTestCase or
      SharedModuleStoreTestCase by specifying an ENABLED_SIGNALS class
      attribute, like the following example:
      
          from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
      
          class MyPublishTestCase(ModuleStoreTestCase):
              ENABLED_SIGNALS = ['course_published', 'pre_publish']
      
      You should take great care when disabling signals outside of a
      ModuleStoreTestCase or SharedModuleStoreTestCase, since they can leak
      out into other tests. Be sure to always clean up, and never disable
      signals outside of testing. Because signals are essentially process
      globals, it can have a lot of unpleasant side-effects if we start
      mucking around with them during live requests.
      
      Overall, this change has cut the total test execution time for
      edx-platform by a bit over a third, though we still spend a lot in
      pre-test setup during our test builds.
      
      [PERF-413]
      David Ormsbee committed
  2. 22 Feb, 2017 1 commit
  3. 17 Feb, 2017 1 commit
  4. 16 Feb, 2017 2 commits
  5. 14 Feb, 2017 4 commits
  6. 13 Feb, 2017 2 commits
  7. 10 Feb, 2017 2 commits
  8. 09 Feb, 2017 1 commit
  9. 08 Feb, 2017 1 commit
  10. 07 Feb, 2017 2 commits
  11. 06 Feb, 2017 1 commit
  12. 05 Feb, 2017 1 commit
  13. 03 Feb, 2017 1 commit
  14. 01 Feb, 2017 3 commits
  15. 31 Jan, 2017 2 commits
  16. 28 Jan, 2017 2 commits
  17. 27 Jan, 2017 1 commit
  18. 26 Jan, 2017 1 commit
    • Disable student state writes for crawlers. · 5ef1e080
      When crawlers like edX-downloader make requests on courseware, they are
      often concurrently loading many units in the same sequence. This causes
      contention for the rows in courseware_studentmodule that store the
      student's state for various XBlocks/XModules, most notably for the
      sequence, chapter, and course -- all of which record and update user
      position information when loaded.
      
      It would be nice if we could actually remove these writes altogether
      and come up with a cleaner way of keeping track of the user's position.
      In general, GETs should be side-effect free. However, any such change
      would break backwards compatibility, and would require close
      coordination with research teams to make sure they weren't negatively
      affected.
      
      This commit identifies crawlers by user agent (CrawlersConfig model),
      and blocks student state writes if a crawler is detected. FieldDataCache
      writes simply become no-ops. It doesn't actually alter the rendering
      of the courseware in any way -- the main impact is that the blocks
      won't record your most recent position, which is meaningless for
      crawlers anyway.
      
      This can also be used as a building block for other policy we want to
      define around crawlers. We just have to be mindful that this only works
      with "nice" crawlers who are honest in their user agents, and that
      significantly more sophisticated (and costly) measures would be
      necessary to prevent crawlers that try to be even trivially sneaky.
      
      [PERF-403]
      David Ormsbee committed
  19. 25 Jan, 2017 3 commits
  20. 24 Jan, 2017 2 commits
  21. 23 Jan, 2017 3 commits
  22. 20 Jan, 2017 1 commit
  23. 19 Jan, 2017 1 commit