Commit bf71732
committed
Use luatex in --luaonly mode to query kpsewhich.
`luatex --luaonly` runs a *lua* interpreter with relevant tex libraries
available, which avoids both the overhead of repeatedly initializing
kpathsea (the old approach, very slow on macos and windows). An
alternative approach would be to use `luatex` followed by `\directlua`
calls, but on windows it appears that one needs to use `lualatex` to get
a working interactive prompt, and just loading the latex format takes
seconds(!).
For the simple following benchmark:
```sh
python -c 'from pylab import *; mpl.use("pdf"); rcParams["text.usetex"] = True; plot(); savefig("test.pdf", backend="pdf")'
```
On a macos machine, this patch brings runtime from ~4.5s to ~2.5s.
On a windows machine, this patch brings runtime from ~6.5s to ~1.7s.
We also need to figure out how to best advertise this (do we emit a
warning suggesting to install luatex on windows and macos if luatex is
not present?).1 parent 266be12 commit bf71732
File tree
3 files changed
+39
-0
lines changed- doc/api/next_api_changes/deprecations
- lib/matplotlib
- mpl-data
3 files changed
+39
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| 28 | + | |
28 | 29 | | |
29 | 30 | | |
30 | 31 | | |
| |||
1040 | 1041 | | |
1041 | 1042 | | |
1042 | 1043 | | |
| 1044 | + | |
| 1045 | + | |
| 1046 | + | |
| 1047 | + | |
| 1048 | + | |
| 1049 | + | |
| 1050 | + | |
| 1051 | + | |
| 1052 | + | |
| 1053 | + | |
| 1054 | + | |
| 1055 | + | |
| 1056 | + | |
| 1057 | + | |
| 1058 | + | |
| 1059 | + | |
| 1060 | + | |
| 1061 | + | |
| 1062 | + | |
| 1063 | + | |
| 1064 | + | |
| 1065 | + | |
1043 | 1066 | | |
| 1067 | + | |
1044 | 1068 | | |
1045 | 1069 | | |
1046 | 1070 | | |
| |||
1058 | 1082 | | |
1059 | 1083 | | |
1060 | 1084 | | |
| 1085 | + | |
1061 | 1086 | | |
1062 | 1087 | | |
1063 | 1088 | | |
| |||
1072 | 1097 | | |
1073 | 1098 | | |
1074 | 1099 | | |
| 1100 | + | |
| 1101 | + | |
| 1102 | + | |
| 1103 | + | |
| 1104 | + | |
| 1105 | + | |
| 1106 | + | |
| 1107 | + | |
1075 | 1108 | | |
1076 | 1109 | | |
1077 | 1110 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
0 commit comments