| Age | Commit message (Collapse) | Author |
|
|
|
|
|
Don't bother with the accessors internally as they're unlikely to do
anything but return a variable. Direct access shaves a percent or two
off parsing.
|
|
print -> print().
Skip 'from __future__ import print_function' by only having a single
argument (to avoid interpretation as tuples in Python 2). Keeps the
examples simple.
|
|
Was returning a dict_values.
|
|
|
|
Consistent with other internal names and avoids the collision with the
function in a neater way.
|
|
- Inline _add_dependent_ignore_siblings().
- Copy the original 'dep' set and add the recursive dependencies to it
instead of creating an initially empty set.
No discernible performance improvement, but bit neater.
|
|
Make somewhat consistent with the other classes.
|
|
Make somewhat consistent with the other classes.
|
|
Put getters together and make consistent with Symbol.
|
|
Put getters together.
|
|
Split into logical sections and put more related methods closer to one
another.
|
|
The old note no longer seems to apply. Going through the defconfig part
of the test suite without verification in PyPy drops from ~5:50 to
~5:30, and line_prof shows some improvement for CPython too.
Passing the 'write' method around instead was a bit slower.
|
|
|
|
Cleaner to just check for more tokens in the few spots that used it.
Seems slightly faster too, though it might be in the noise.
|
|
The most common case by far (> 85% for both && and || with the x86
Kconfigs) is a single operand (i.e., no && or ||). Sticking it in a list
and then immediately throwing the list away is wasteful.
Makes _parse_expr() at least 10% faster during testing.
|
|
|
|
Matches their function.
|
|
Instantiating that nested function with free variables turned out to be
quite expensive in cProfile.
For the _build_dep() case, it would be even neater to have a function
like _add_sym_deps(sym, expr) that adds 'sym' to each 'deps' set in
'expr', removing the need for a temporary set. Unfortunately,
_get_expr_syms() is used elsewhere too, and it's probably not worthwhile
having another very similar function just as a small optimization.
|
|
Redundant, plus we get more coverage for the default state.
|
|
Bit friendlier.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Simpler.
|
|
|
|
|
|
Speeds _Feed creation up a bit during tokenization. Keep public classes
slotless for flexibility.
|
|
Optimization. Saves an 'if None' check for each 'help'.
|
|
Small optimization. No need to fetch it for 'help' tokens, which return
early.
|
|
The regexes handle most stripping of trailing space now too.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- Get rid of the weird strip/reindex dance and keep 's' intact
throughout. This also fixes _tokenization_error() output, as it would
previously report the stripped string.
- Strip trailing whitespace in the regexes. This makes the stripping
loop very cheap.
- Shorten a comment that might've been more confusing than helpful.
|
|
We're never updating nodes here, since the original expressions should
be preserved. We're just trying to avoid creating redundant nodes.
|
|
|
|
|
|
Use python3 if testsuite.py was run with python3, etc.
|
|
|
|
Only way it's used.
|
|
The line number was previously for logical lines only. Oversight.
Get rid of _get_lines() and keep the raw lines in _FileFeed instead,
only joining lines with continuation lines as they are fetched. This
makes the index correspond to the correct line number from the file. (It
also means most lines are returned as-is without any logic applied to
them, which is nice.)
Litter tests/Klocation with continuation lines to get test coverage.
Remove some unused functions that were previously inherited from _Feed
and remove it as a base class of _FileFeed.
|
|
|