Use lru_cache instead of a dict cache in MultiStrategyDispatch
Use lru_cache instead of a dict cache in MultiStrategyDispatch

The LRU cache is faster, and also bounded, which is always a good idea.

Before:

         11507879 function calls (8282104 primitive calls) in 5.263 seconds

   Ordered by: internal time

   ncalls  tottime  percall  cumtime  percall filename:lineno(function)
1725000/100000    1.090    0.000    2.765    0.000 converters.py:103(unstructure)
150000/25000    0.690    0.000    2.852    0.000 converters.py:176(unstructure_attrs_asdict)
150000/25000    0.670    0.000    2.331    0.000 converters.py:267(structure_attrs_fromdict)
1250000/100000    0.588    0.000    2.225    0.000 converters.py:281(_structure_attr_from_dict)
  1900000    0.393    0.000    0.416    0.000 multistrategy_dispatch.py:29(dispatch)
  1350017    0.200    0.000    0.220    0.000 {method 'get' of 'dict' objects}
  1250100    0.194    0.000    0.194    0.000 {built-in method builtins.getattr}
   100000    0.179    0.000    1.459    0.000 converters.py:346(_structure_union)
   575000    0.169    0.000    0.824    0.000 converters.py:202(<genexpr>)
   100000    0.150    0.000    0.975    0.000 converters.py:199(_unstructure_seq)

After:

         9582897 function calls (6357122 primitive calls) in 4.660 seconds

   Ordered by: internal time

   ncalls  tottime  percall  cumtime  percall filename:lineno(function)
1725000/100000    0.920    0.000    2.282    0.000 converters.py:103(unstructure)
150000/25000    0.708    0.000    2.370    0.000 converters.py:176(unstructure_attrs_asdict)
150000/25000    0.664    0.000    2.211    0.000 converters.py:267(structure_attrs_fromdict)
1250000/100000    0.555    0.000    2.107    0.000 converters.py:281(_structure_attr_from_dict)
  1250100    0.204    0.000    0.204    0.000 {built-in method builtins.getattr}
  1350017    0.199    0.000    0.219    0.000 {method 'get' of 'dict' objects}
   100000    0.181    0.000    1.368    0.000 converters.py:346(_structure_union)
   575000    0.161    0.000    0.641    0.000 converters.py:202(<genexpr>)
   100000    0.154    0.000    0.795    0.000 converters.py:199(_unstructure_seq)

python-attrs/cattrs,Tinche/cattrs