1. 07 Sep, 2018 20 commits
  2. 05 Sep, 2018 4 commits
  3. 04 Sep, 2018 2 commits
  4. 03 Sep, 2018 2 commits
  5. 01 Sep, 2018 5 commits
    • Vincent Pelletier's avatar
      SQLCatalog: Optimise and simplify transactional_cache_decorator. · 189db11c
      Vincent Pelletier authored
      Auto-generate cache_id, removing the risk of duplicating one.
      Inline getInstanceID as it is its only caller left.
      Avoid wrapping if getTransactionalVariable cannot be imported.
      Avoid intermediate variables, at the cost of dupicating logic but
      accelerating run-time.
      Use functools.wraps .
      Access _cache_sequence_number directly - these pieces of code are friends
      anyway, we already set a volatile property on Catalog instance. Saves one
      getattr and one call.
      189db11c
    • Vincent Pelletier's avatar
      SQLCatalog: Assorted cleanups and simplifications. · 66f13089
      Vincent Pelletier authored
      No backslash at EOL.
      Avoid splitting messages, to ease code lookup.
      LOG's "error" argument accepts a boolean, which removes the need to touch
      sys.exc_info.
      Use modern exception raising syntax.
      66f13089
    • Vincent Pelletier's avatar
      b0978eaf
    • Vincent Pelletier's avatar
      SQLCatalog: Drop unused function. · 1f2850cd
      Vincent Pelletier authored
      1f2850cd
    • Vincent Pelletier's avatar
      SQLExpression: Fold _getSelectDict into __init__, its only caller. · 028060e6
      Vincent Pelletier authored
      _getSelectDict was also calling itself on sub-sql_expressions, but this
      was useless: they would already have called it, and discarded one of its
      returned values. Instead, preserve both returned values in __init__ and
      access these attributes directly when iterating over sub-sql_expressions.
      Also, fold canMergeSelectDict back into its only 2 call places, saving one
      getattr and one call.
      Also, get rid of a few properties which were only used in _getSelectDict.
      Also, get rid of two iterable copies: sql_expression_list when it is
      already a list (no need to cast it again to a list, we just built one with
      the list comprehension), and select_dict being cast into a list when
      entering _getSelectDict, despite not being used (besides in extra
      _getSelectDict calls, which are now entirely avoided).
      028060e6
  6. 31 Aug, 2018 3 commits
  7. 29 Aug, 2018 4 commits
    • Vincent Pelletier's avatar
    • Vincent Pelletier's avatar
      ZMySQLDA: Optimise date & datetime parsing in results. · 01e14257
      Vincent Pelletier authored
      A pprofile run shows DateTime_or_None costing 3ms per value (including all
      callees).
      While this may seem low, it is common to receive hundreds of such values
      in single query results (ex: web mode document & webpage lookups),
      so the total time spent parting dates per query can become significantly
      larger than the time to execute the query itself.
      In the case of this measure setup, 504 dates were processed for a total of
      1.5 seconds.
      DateTime is slow to parse strings because it cannot rely on a pre-known
      format. With MySQL/MariaDB, the format is know for those column types, so
      implement specific parsing to get better performance.
      On the same setup, pprofile run shows a parsing time of 123µs per value in
      DATETIME_to_DateTime_or_None, or 65ms total.
      DATE_to_DateTime_or_None should not deviate significantly from this.
      01e14257
    • Vincent Pelletier's avatar
      Revert "ZMySQLDA: Optimise date & datetime parsing in results." · 2dc4c674
      Vincent Pelletier authored
      For some reason, unit tests all broke while testing this revision. The
      relation between both is not clear to me (this code has worked for me).
      In doubt, I revert it for now.
      This reverts commit 0057272c.
      2dc4c674
    • Vincent Pelletier's avatar
      erp5_hal_json_style: Do not call getRelativeUrl to just traverse it one call later · 6dd3a2cc
      Vincent Pelletier authored
      getRelativeUrl and restrictedTraverse are expensive operations. Do not
      involve them pointlessly.
      Also, boolean evaluation of lists is a thing.
      6dd3a2cc