Commit 0ea1ba8
committed
perf(utils): skip recursion into non-container list elements
In convert_to_base64, when iterating list/tuple elements, only recurse
into dicts, lists, and tuples. Strings and numbers can never contain
numpy arrays, so recursing into them wastes ~500K function calls on
figures with large text arrays.1 parent db79f58 commit 0ea1ba8
1 file changed
Lines changed: 2 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
126 | 126 | | |
127 | 127 | | |
128 | 128 | | |
129 | | - | |
| 129 | + | |
| 130 | + | |
130 | 131 | | |
131 | 132 | | |
132 | 133 | | |
| |||
0 commit comments