pkittenis/graphite-influxdb — pull request #1 by pkittenis (2014-12-05 15:02:08+00:00)
Title: Fixes

Top 30 slowest function calls by sorted by time.

Regex match and compile are both in top 10 with the most number of calls, after algorithm and regex refactor giving 4x speedup.

```
Fri Dec 5 14:53:10 2014 stats

619057 function calls (606918 primitive calls) in 22.490 seconds

Ordered by: internal time
List reduced from 3169 to 30 due to restriction <30>

ncalls tottime percall cumtime percall filename:lineno(function)
48 21.770 0.454 21.771 0.454 {select.select}
2 0.070 0.035 0.244 0.122 yacc.py:869(parseopt_notrack)
5922 0.029 0.000 0.070 0.000 lex.py:304(token)
24939 0.028 0.000 0.028 0.000 {method 'match' of '_sre.SRE_Pattern' objects}
18 0.023 0.001 0.023 0.001 {method 'recv' of '_socket.socket' objects}
1130/275 0.019 0.000 0.051 0.000 sre_parse.py:379(_parse)
735 0.015 0.000 0.034 0.000 sre_compile.py:207(_optimize_charset)
1914/195 0.013 0.000 0.047 0.000 sre_compile.py:32(_compile)
1 0.013 0.013 0.013 0.013 auth.py:8()
12818 0.011 0.000 0.013 0.000 sre_parse.py:182(__next)
40724 0.010 0.000 0.012 0.000 {isinstance}
1360 0.010 0.000 0.022 0.000 c_parser.py:357(_build_declarations)
6 0.010 0.002 0.012 0.002 sre_compile.py:301(_optimize_unicode)
84103 0.009 0.000 0.009 0.000 {method 'append' of 'list' objects}
2341/428 0.008 0.000 0.020 0.000 cparser.py:293(_get_type)
41907 0.007 0.000 0.007 0.000 {method 'get' of 'dict' objects}
52778/48411 0.007 0.000 0.008 0.000 {len}
24481 0.006 0.000 0.006 0.000 yacc.py:197(__getitem__)
2567/858 0.005 0.000 0.006 0.000 sre_parse.py:140(getwidth)
151 0.005 0.000 0.005 0.000 sre_compile.py:258(_mk_bitmap)
1374 0.005 0.000 0.006 0.000 c_parser.py:295(_fix_decl_name_type)
12 0.005 0.000 0.006 0.000 collections.py:288(namedtuple)
18370 0.005 0.000 0.005 0.000 yacc.py:201(__setitem__)
5922 0.004 0.000 0.074 0.000 c_lexer.py:76(token)
1366 0.004 0.000 0.009 0.000 c_parser.py:971(p_direct_declarator_1)
3634 0.004 0.000 0.006 0.000 plyparser.py:47(_coord)
7450 0.004 0.000 0.007 0.000 sre_parse.py:130(__getitem__)
10607 0.004 0.000 0.015 0.000 sre_parse.py:201(get)
24 0.004 0.000 0.004 0.000 {method 'read' of 'file' objects}
1 0.004 0.004 0.004 0.004 yacctab.py:4()
```