-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Open
Labels
Description
- We should be able to reduce the whitespace significantly, to make the file smaller. Could even collapse it to a single line, I'm not sure there's much value keeping it human-readable, but maybe @emilykl has opinions about this. If we really want to optimize file size we could also change its structure a bit - like if every entry is a dict
{params, superclass}this could be converted to a length-2 list. But the whitespace is the biggest piece of this. json.loadis pretty fast, ~41ms on my computer. But it's even faster if we just make this a Python file. In my quick test I just added:
true=True
false=False
null=None
v =
to the beginning of the file to convert the JSON to Python, and then from validators._validators import v took only ~25ms. (If we do this for real we should be able to tweak the json.dump to output Python in the first place so we don't need to alias true, false, and null).
Reactions are currently unavailable