[wanproxy/wanproxy] db6b2c: Completely disable lock assertions under NDEBUG.

Juli Mallett juli at clockworksquid.com
Thu Jan 28 12:47:08 PST 2016


  Branch: refs/heads/master
  Home:   https://github.com/wanproxy/wanproxy
  Commit: db6b2cd7ce0e8a431d9e6b6a93bf0f8a9625568a
      https://github.com/wanproxy/wanproxy/commit/db6b2cd7ce0e8a431d9e6b6a93bf0f8a9625568a
  Author: Juli Mallett <juli at clockworksquid.com>
  Date:   2016-01-28 (Thu, 28 Jan 2016)

  Changed paths:
    M common/thread/lock.h
    M common/thread/mutex.h
    M common/thread/mutex_posix.cc

  Log Message:
  -----------
  Completely disable lock assertions under NDEBUG.

This triples the speed of callback-speed1 on Mac OS X, due to avoiding
allocating strings for the LogHandle which, by definition, cannot be
used, but which must be constructed to be passed to the method.

Removing the method entirely and nullifying the assertion macros
themselves eliminates this issue fully.


  Commit: 2a17d0dca26e75ea57de85554b022c35e3ec1ea4
      https://github.com/wanproxy/wanproxy/commit/2a17d0dca26e75ea57de85554b022c35e3ec1ea4
  Author: Juli Mallett <juli at clockworksquid.com>
  Date:   2016-01-28 (Thu, 28 Jan 2016)

  Changed paths:
    M common/thread/sleep_queue_posix.cc

  Log Message:
  -----------
  Use the mutex_ member when initializing the state.

If we pull it from the parameter instead, a compiler might work out
that we don't actually use mutex_, which is a private member.


  Commit: fce1b6272833bdf386cf52b53dfb0990cdc52e15
      https://github.com/wanproxy/wanproxy/commit/fce1b6272833bdf386cf52b53dfb0990cdc52e15
  Author: Juli Mallett <juli at clockworksquid.com>
  Date:   2016-01-28 (Thu, 28 Jan 2016)

  Changed paths:
    M event/callback.cc
    M event/callback.h

  Log Message:
  -----------
  Don't track whether a callback is scheduled if NDEBUG.

When we have debugging turned off, we don't get any value out of
tracking whether a callback has been scheduled.  Instead, turn off
the scheduled_ field entirely, and simplify the methods that would
manipulate or check it.  This yields another significant increase
in performance with NDEBUG set for callback-speed1.


Compare: https://github.com/wanproxy/wanproxy/compare/7c5bfad7a5a7...fce1b6272833


More information about the wanproxy mailing list