Commit 56a5153
committed
Simplify definition of mathtext symbols.
Use a single regex that handles both single_symbol (a single character)
and symbol_name (`\knowntexsymbolname`), and also slightly simplify the
"end-of-symbol-name" regex.
This parsing element comes up extremely often, and removing one
indirection layers shaves off ~3-4% off drawing all the current mathtext
tests, i.e.
```
MPLBACKEND=agg python -c 'import time; from pylab import *; from matplotlib.tests.test_mathtext import math_tests; fig = figure(figsize=(3, 10)); fig.text(0, 0, "\n".join(filter(None, math_tests)), size=6); start = time.perf_counter(); [fig.canvas.draw() for _ in range(10)]; print((time.perf_counter() - start) / 10)'
```1 parent dab648a commit 56a5153
1 file changed
+7
-8
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| 11 | + | |
11 | 12 | | |
12 | 13 | | |
13 | 14 | | |
| |||
1723 | 1724 | | |
1724 | 1725 | | |
1725 | 1726 | | |
1726 | | - | |
1727 | | - | |
1728 | | - | |
1729 | | - | |
1730 | 1727 | | |
1731 | | - | |
1732 | | - | |
1733 | | - | |
1734 | | - | |
| 1728 | + | |
| 1729 | + | |
| 1730 | + | |
| 1731 | + | |
| 1732 | + | |
| 1733 | + | |
1735 | 1734 | | |
1736 | 1735 | | |
1737 | 1736 | | |
| |||
0 commit comments