{"push_id":1122409202,"size":1,"distinct_size":1,"ref":"refs/heads/master","head":"e0563252e04461d03e191022877f9c326e4c7822","before":"838d692052475a650a0d9199075110cf369ece00","commits":[{"sha":"e0563252e04461d03e191022877f9c326e4c7822","author":{"email":"eb6a56576da4acdb4a62a56a6331a383d135bdb1@gmail.com","name":"Edward K. Ream"},"message":"Added NullChecker class in order to measure the relative speed tree traversals.\nThe AstFullTraverser class is about twice as fast as the tree *traversal* code in the Checker class.\nAs shown below, making Checker a subclass of AstFullTraverser would make Checker about 10% faster.\nHowever, there are drawbacks in doing so, also discussed below.\n\nHere are representative statistics for a test run against all of Leo's files:\n\nrun_test scope: all\n370 files\n read  0.03 sec\n parse  2.45 sec\n visit  0.62 sec\nhandle  1.15 sec\n check  2.46 sec\n total  6.73 sec\n\n Parsing (creating the ast tree) is surprisingly expensive.\n Handle is the traversal time for NullChecker.\n Visit is the traversal time for leo_ast.AstFullTraverser.\n\n There are pros and cons of using AstFullTraverser:\n\n Pros:\n - Faster. In the test, using AstFullTraverser saves about 1.1-0.6 = 0.5 sec or about 10% of total time.\n   The total time should be reduced by both the visit and handle times: 6.7-1.1-0.6 sec = 5.0 sec.\n - Visits nodes in a known, explicit order.\n   Important for token syncing, but not important for Pyflakes.\n - A good template for formatter classes.  Again, not important here.\n - Handles both Python 2 and 3 without switches.\n   Not significant, because the visitors contain tests that are equivalent to the switches.\n\n Cons:\n - Inherently more fragile.\n - More code, but fully encapsulated in the AstFullTraverser class.\n   Making the Checker class a subclass of AstFullTraverser would eliminate code in the Checker.\n - Must be updated when new node types are created.","distinct":true,"url":"https://api.github.com/repos/edreamleo/pyflakes-study/commits/e0563252e04461d03e191022877f9c326e4c7822"}]}
{"actor":{"display_login":"edreamleo"}}