ronaldoussoren / pyobjc

The Python <-> Objective-C Bridge with bindings for macOS frameworks
https://pyobjc.readthedocs.io
563 stars 47 forks source link

test_callable_metadata_is_sane in Cocoa bindings is very slow #535

Closed ronaldoussoren closed 1 year ago

ronaldoussoren commented 1 year ago

The test_callable_metadata_is_sane method in test_cocoa.py of the Cocoa bindings is very slow.

I expect that this cannot be fixed, this explicitly introspects every class and method in the Objective-C runtime which is known to be slow. That said, I haven't tried using a profiler with this yet to see if there's something we can do about this.

The test it still useful and at times finds problems, so won't be removed.

ronaldoussoren commented 1 year ago

One thing that might be a problem: the test causes the lazy loader to load all symbols, being smarter about which symbols get loaded could help (but requires accessing internals of the lazy loader)...