1. 28 Şub, 2008 3 kayıt (commit)
    • Jeffrey Yasskin's avatar
      Thread.start() used sleep(0.000001) to make sure it didn't return before the · 69e1309f
      Jeffrey Yasskin yazdı
      new thread had started. At least on my MacBook Pro, that wound up sleeping for
      a full 10ms (probably 1 jiffy). By using an Event instead, we can be absolutely
      certain that the thread has started, and return more quickly (217us).
      
      Before:
      $  ./python.exe -m timeit -s 'from threading import Thread'  't = Thread(); t.start(); t.join()'
      100 loops, best of 3: 10.3 msec per loop
      $  ./python.exe -m timeit -s 'from threading import Thread; t = Thread()'  't.isAlive()'
      1000000 loops, best of 3: 0.47 usec per loop
      
      After:
      $  ./python.exe -m timeit -s 'from threading import Thread'  't = Thread(); t.start(); t.join()'
      1000 loops, best of 3: 217 usec per loop
      $  ./python.exe -m timeit -s 'from threading import Thread; t = Thread()'  't.isAlive()'
      1000000 loops, best of 3: 0.86 usec per loop
      
      To be fair, the 10ms isn't CPU time, and other threads including the spawned
      one get to run during it. There are also some slightly more complicated ways to
      get back the .4us in isAlive() if we want.
      69e1309f
    • Jeffrey Yasskin's avatar
      Speed test_socketserver up from 28.739s to 0.226s, simplify the logic, and make · 180997b2
      Jeffrey Yasskin yazdı
      sure all tests run even if some fail.
      180997b2
    • Jeffrey Yasskin's avatar
      Move abc._Abstract into object by adding a new flag Py_TPFLAGS_IS_ABSTRACT, · 960b9b7a
      Jeffrey Yasskin yazdı
      which forbids constructing types that have it set. The effect is to speed
      
        ./python.exe -m timeit -s 'import abc' -s 'class Foo(object): __metaclass__ = abc.ABCMeta' 'Foo()'
      
      up from 2.5us to 0.201us. This fixes issue 1762.
      960b9b7a
  2. 27 Şub, 2008 3 kayıt (commit)
  3. 26 Şub, 2008 11 kayıt (commit)
  4. 25 Şub, 2008 13 kayıt (commit)
  5. 24 Şub, 2008 10 kayıt (commit)