An error occurred fetching the project authors.
  1. 25 Oct, 2018 2 commits
    • Vincent Pelletier's avatar
      ERP5Catalog: Reduce reliance on user lookup. · 4c514da5
      Vincent Pelletier authored
      Use Owner role to help filling user_set: owners must be users, never
      groups.
      Only look for users among group_ids when they are candidate for indexation
      into a catalog_role column. This should very significantly reduce the
      number of user lookups, even bringing it to zero on instance with default
      catalog setting of catalog_role_set = set(["viewable_owner"]) .
      Also, only look for users if there are candidates for lookup.
      Also, rename local variable to better describe its content.
      Also, use set.__iadd__ instead of set.update (shorter).
      4c514da5
    • Vincent Pelletier's avatar
      ERP5Catalog: Assorted simplifications. · 9542da22
      Vincent Pelletier authored
      Test loop invariant outside of loop.
      Use clearer and more consistent variable names.
      Avoid iterating twice when once is enough, allowing removal of
      "local_role_dict" local and simplification of corresponding dict
      structure.
      Avoid creating new instances when the existing one can be mutated.
      Evaluate dict as boolean instead of constructing an empty dict to compare
      against.
      Avoid using %-operator just to concatenate strings (allows en-passant
      typechecking).
      Drop unused locals.
      Do not use a dict when a set would be sufficient.
      9542da22
  2. 09 Mar, 2018 1 commit
  3. 07 Mar, 2018 1 commit
  4. 20 Nov, 2017 2 commits
    • Ayush Tiwari's avatar
      erp5_catalog: Dynamic migration of ZMI catalog to ERP5-ified catalog · 7d897440
      Ayush Tiwari authored
      And, Patch changeObjectClass extension to remove useless attributes
      
      Copying __dict__ from one object to another brings us to situation where
      we don't have many objects which we don't need at all, for example, migrating
      objects with subclasses who were initially OFS objects and later an ERP5
      object can lead to adding subobjects as attributes of the new object, which
      is completely undesirable. To handle this, it is important to delete the
      sub-objects as the attributes for those migrated classes.
      
      Old Catalog Tool didn't have portal_type attribute, so while migrating
      via synchronizeDynamicModule, after _bootstrap, we expect the tool to
      have a portal_type to finalize migration.
      
      This step is now being done only at the end of _bootstrap after we
      change the classes for portal_catalog and its sub-objects.
      7d897440
    • Ayush Tiwari's avatar
      erp5_catalog: Rename reindexObject method to use them as new methods for CatalogTool. · 1200801e
      Ayush Tiwari authored
      - This step is needed due to the use of BaseTool as Base class for CatalogTool
        due to which there were conflict between reindexObject from the Base and the one
        from the BaseTool.
      1200801e
  5. 03 Oct, 2017 1 commit
  6. 15 Sep, 2017 2 commits
  7. 13 Sep, 2017 1 commit
  8. 01 Sep, 2017 3 commits
  9. 31 Aug, 2017 1 commit
    • Vincent Pelletier's avatar
      CatalogTool: Split getCategoryParameterDict in 2 · 79119142
      Vincent Pelletier authored
      One part working on {base_category_id: [document_value_set]}, and the other
      producing that structure out of a flat list of (base_category_id-prefixed)
      category relative urls.
      The former used to be included in the latter, but in some case caller
      already has the documents handy instead of only urls, in which case we can
      avoid a layer of document lookups.
      79119142
  10. 25 Aug, 2017 1 commit
  11. 27 Jul, 2017 4 commits
  12. 28 Jun, 2017 2 commits
  13. 18 May, 2017 1 commit
  14. 14 Apr, 2017 2 commits
    • Vincent Pelletier's avatar
      {ERP5,ZSQL}Catalog: Wrap all documents at once. · 8a278cbd
      Vincent Pelletier authored
      Allows reducing the number of user existence check queries from one per
      document to one per document batch, reducing database (currently, catalog)
      latency effect on indexation time.
      Also, avoid object -> id -> object dance for SQLCatalog instance while at
      it.
      Also, modernise syntax a bit, avoiding intermediate locals mostly.
      8a278cbd
    • Vincent Pelletier's avatar
      ERP5Catalog: Do not retrieve workflow catalog variables. · b62e851e
      Vincent Pelletier authored
      These are used nowhere in the code. In many workflows, these
      "catalog-available" variables are only configured so they appear as fields on
      worklist definitions. So it is understood as more of an informative setting
      having a local effect than a normative one having an effect on how
      indexation happens.
      So shave off a bit of useless time spent in indexation.
      Also, it should be mentionned that when profiling this code causes a big
      red-herring: this code is the first place where workflow history gets
      loaded (and presumably indexed document itself), which draws attention
      away from potentially more interesting areas.
      b62e851e
  15. 05 Apr, 2017 1 commit
  16. 03 Apr, 2017 1 commit
  17. 23 Dec, 2016 1 commit
  18. 20 Dec, 2016 3 commits
  19. 12 Dec, 2016 1 commit
  20. 24 May, 2016 3 commits
    • Vincent Pelletier's avatar
      CatalogTool: Assorted readability improvements. · da29e93c
      Vincent Pelletier authored
      Fix a misnamed local.
      Use iteritems.
      Move variables next to the loop they act on.
      Rewrite comments to better reflect the intention when it is not obvious in
      the implementation.
      Move a loop-invariant out of loop ((user, role) not in optimized_role_set).
      Do not use set.update on an iterable constructed just for the call, call
      set.add on each item.
      da29e93c
    • Vincent Pelletier's avatar
      CatalogTool: Avoid computing user's roles when just testing existence. · ed0c06f9
      Vincent Pelletier authored
      Global role computation is very expensive, don't do it when all we are
      interested in is user existence.
      Also, list all users having local roles in one call to reduce the effect
      of per-call overhead.
      This should improve indexation speed by a large fraction: pprofile
      statistical run on and activity node busy reindexing objects shows:
      - 57% of time spend generating (13%) and executing (44%) SQL
      - 42% of time spent preparing object for indexation:
        - 29% in _getSecurityParameterList, all in getUserById
        - 12% in getCatalogVariablesFor (workflow variables to index)
      So an improvement of close to 30% is expected.
      ed0c06f9
    • Vincent Pelletier's avatar
      CatalogTool: Move getUserById call up one loop. · 6be1d3a1
      Vincent Pelletier authored
      Its parameter is a loop invariant, so avoid looking the same user up once
      per local role.
      6be1d3a1
  21. 12 Jan, 2016 1 commit
  22. 24 Sep, 2015 1 commit
  23. 23 Sep, 2015 2 commits
  24. 14 Aug, 2015 2 commits