> I've had a report from a user that Plex runs about half > as fast in 2.5 as it did in 2.4. In particular, the > NFA-to-DFA conversion phase, which does a lot of > messing about with dicts representing mappings between > sets of states. > > Does anyone in the Ministry for Making Python Blazingly > fast happen to know of some change that might have > pessimised things in this area? Hello, I investigated. On my environment, consumed time is E:\Plex-1.1.5>py24 plex_test2.py 0.710999965668 E:\Plex-1.1.5>py25 plex_test2.py 0.921999931335 And after I applied this patch to Plex/Machines, (make `Node' new style class) 62c62 < class Node: --- > class Node(object): E:\Plex-1.1.5>py24 plex_test2.py 0.401000022888 E:\Plex-1.1.5>py25 plex_test2.py 0.350999832153 So, probably hash, comparation mechanizm of old/new style class has changed. # improved for new style class, worse for old style class. Maybe optimized for new style class? Try this for minimum test. import timeit init = """ class Class: pass c1 = Class() c2 = Class() """ t1 = timeit.Timer(""" c1 < c2 """, init) t2 = timeit.Timer(""" hash(c1) hash(c2) """, init) print t1.timeit(1000) print t2.timeit(1000)
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4