[Pydev-cvs] org.python.pydev.parser/tests/org/python/pydev/parser/profile ParseBigFile.java, 1.4,
Brought to you by:
fabioz
From: Fabio Z. <fa...@us...> - 2008-09-27 19:59:26
|
Update of /cvsroot/pydev/org.python.pydev.parser/tests/org/python/pydev/parser/profile In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20472/tests/org/python/pydev/parser/profile Modified Files: ParseBigFile.java Log Message: Synching to latest changes: Pydev <ul> <li><strong>Editor</strong>: Cursor settings no longer overridden</li> <li><strong>Code-completion</strong>: If __all__ is defined with runtime elements (and not only in a single assign statement), it's ignored for code-completion purposes</li> <li><strong>Debugger</strong>: Pythonpath the same in debug and regular modes (sys.path[0] is the same directory as the file run)</li> <li><strong>Debugger</strong>: Persist choices done in the debugger when files from the debugger are not found</li> <li><strong>Interpreter config</strong>: "email" automatically added to the "forced builtins"</li> <li><strong>Parser</strong>: Correctly recognizing absolute import with 3 or more levels</li> <li><strong>Syntax check</strong>: Option to do only on active editor</li> </ul> Also: tabs changed for spaces Index: ParseBigFile.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev.parser/tests/org/python/pydev/parser/profile/ParseBigFile.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** ParseBigFile.java 28 Apr 2006 13:43:41 -0000 1.4 --- ParseBigFile.java 27 Sep 2008 19:58:43 -0000 1.5 *************** *** 14,75 **** public class ParseBigFile extends PyParserTestBase { ! public static void main(String[] args) { ! junit.textui.TestRunner.run(ParseBigFile.class); ! } ! protected void setUp() throws Exception { ! super.setUp(); ! } ! protected void tearDown() throws Exception { ! super.tearDown(); ! } ! /** ! * Initial times with 5 iterations: ! * ! * Took: 1.625 secs ! * Took: 0.797 secs ! * Took: 0.828 secs ! * Took: 0.766 secs ! * Took: 0.765 secs ! * ! * After using the FastCharStream: ! * ! * Took: 0.453 secs ! * Took: 0.14 secs ! * Took: 0.14 secs ! * Took: 0.141 secs ! * Took: 0.14 secs ! * ! * (impressive hum?) ! * ! * -- note that this is directly proportional to the size of the string, so, while in small streams ! * there will be no noticeable change, in longer files the changes will be dramatical. E.g. A file ! * with 3MB of code would take about 3 minutes with the previous approach and would take 2 seconds with ! * the new approach. ! * ! * @throws Exception ! */ ! public void testBigFileParsing() throws Exception { String loc = TestDependent.TEST_PYDEV_PARSER_PLUGIN_LOC+"/tests/pysrc/data_string.py"; String s = REF.getFileContents(new File(loc)); for (int i = 0; i < 5; i++) { ! @SuppressWarnings("unused") long curr = System.currentTimeMillis(); ! SimpleNode node = parseLegalDocStr(s); ! ! PyParser.USE_FAST_STREAM = true; ! //uncomment line below to see the time for parsing ! //System.out.println(StringUtils.format("Took: %s secs", (System.currentTimeMillis()-curr)/1000.0)); ! SequencialASTIteratorVisitor visitor = SequencialASTIteratorVisitor.create(node); ! ! ASTEntry entry = visitor.getAsList(Str.class).get(0); ! String s0 = ((Str)entry.node).s; ! assertEquals(42, entry.node.beginLine); ! assertEquals(8, entry.node.beginColumn); ! assertTrue("Expecting big string. Received"+s0, s0.length() > 100 ); ! ! } ! } } --- 14,75 ---- public class ParseBigFile extends PyParserTestBase { ! public static void main(String[] args) { ! junit.textui.TestRunner.run(ParseBigFile.class); ! } ! protected void setUp() throws Exception { ! super.setUp(); ! } ! protected void tearDown() throws Exception { ! super.tearDown(); ! } ! /** ! * Initial times with 5 iterations: ! * ! * Took: 1.625 secs ! * Took: 0.797 secs ! * Took: 0.828 secs ! * Took: 0.766 secs ! * Took: 0.765 secs ! * ! * After using the FastCharStream: ! * ! * Took: 0.453 secs ! * Took: 0.14 secs ! * Took: 0.14 secs ! * Took: 0.141 secs ! * Took: 0.14 secs ! * ! * (impressive hum?) ! * ! * -- note that this is directly proportional to the size of the string, so, while in small streams ! * there will be no noticeable change, in longer files the changes will be dramatical. E.g. A file ! * with 3MB of code would take about 3 minutes with the previous approach and would take 2 seconds with ! * the new approach. ! * ! * @throws Exception ! */ ! public void testBigFileParsing() throws Exception { String loc = TestDependent.TEST_PYDEV_PARSER_PLUGIN_LOC+"/tests/pysrc/data_string.py"; String s = REF.getFileContents(new File(loc)); for (int i = 0; i < 5; i++) { ! @SuppressWarnings("unused") long curr = System.currentTimeMillis(); ! SimpleNode node = parseLegalDocStr(s); ! ! PyParser.USE_FAST_STREAM = true; ! //uncomment line below to see the time for parsing ! //System.out.println(StringUtils.format("Took: %s secs", (System.currentTimeMillis()-curr)/1000.0)); ! SequencialASTIteratorVisitor visitor = SequencialASTIteratorVisitor.create(node); ! ! ASTEntry entry = visitor.getAsList(Str.class).get(0); ! String s0 = ((Str)entry.node).s; ! assertEquals(42, entry.node.beginLine); ! assertEquals(8, entry.node.beginColumn); ! assertTrue("Expecting big string. Received"+s0, s0.length() > 100 ); ! ! } ! } } |