colour: Reading 65^3 Iridas 3D LUT is incredibly slow.

First time using Colour. Trying to read loads of 65^3 .cube files in Jupyter notebook. It takes over 3 mins on the first one.

%time LUT = cs.io.read_LUT_IridasCube(luts[126])

CPU times: user 3min 20s, sys: 1.88 s, total: 3min 22s
Wall time: 3min 22s

Changing https://github.com/colour-science/colour/blob/2b2ad0a0f2052a1a0b4b076b489687235e804fdf/colour/io/luts/iridas_cube.py#L135

to

table.append(tokens)

gives no difference to the result and computes faster

%time LUTfast = read_LUT_IridasCube(luts[126])
CPU times: user 633 ms, sys: 26.2 ms, total: 659 ms
Wall time: 661 ms
np.allclose(LUTfast.table, LUT.table)

True

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 17 (11 by maintainers)

Most upvoted comments

@lavrovd : @njwardhan’s PR #596 has been merged in the develop branch, so it should be up to full speed now! When you have a chance, let us know if it is fine, I’m assuming it is!

===============================================================================
*                                                                             *
*   Interpreter :                                                             *
*       python : 3.7.2 (default, Dec 29 2018, 00:00:04)                       *
*                [Clang 4.0.1 (tags/RELEASE_401/final)]                       *
*                                                                             *
*   colour-science.org :                                                      *
*       colour : 0.3.15                                                       *
*                                                                             *
*   Runtime :                                                                 *
*       imageio : 2.5.0                                                       *
*       matplotlib : 2.2.3                                                    *
*       numpy : 1.15.4                                                        *
*       pandas : 0.24.2                                                       *
*       scipy : 1.1.0                                                         *
*       six : 1.12.0                                                          *
*                                                                             *
===============================================================================
Out[4]:
defaultdict(collections.OrderedDict,
            {'Interpreter': OrderedDict([('python',
                           '3.7.2 (default, Dec 29 2018, 00:00:04) \n[Clang 4.0.1 (tags/RELEASE_401/final)]')]),
             'colour-science.org': OrderedDict([('colour', '0.3.15')]),
             'Runtime': OrderedDict([('imageio', '2.5.0'),
                          ('matplotlib', '2.2.3'),
                          ('numpy', '1.15.4'),
                          ('pandas', '0.24.2'),
                          ('scipy', '1.1.0'),
                          ('six', '1.12.0')])})