Re: [python-win32] Dispatch vs EnsureDispatch performance

2024-08-26 Thread Mark Hammond
On 2024-07-17 10:30 a.m., Sven Bardos via python-win32 wrote: Hi Mark, I found some time to debug and profile my issue a little bit more. In my scenario I call a COM method which returns a list of 14195 integers plus the amount of the found objects. If I profile that call I get the following

Re: [python-win32] Dispatch vs EnsureDispatch performance

2024-07-17 Thread Sven Bardos via python-win32
Hi Mark, I found some time to debug and profile my issue a little bit more. In my scenario I call a COM method which returns a list of 14195 integers plus the amount of the found objects. If I profile that call I get the following: ncalls tottime percall cumtime percall filename:lineno(funct

Re: [python-win32] Dispatch vs EnsureDispatch performance

2024-04-17 Thread Mark Hammond
I'm mildly surprised by that - a profiler might show some low-hanging fruit, and/or might show different characteristics when many more functions are used. However, the primary reason for EnsureDispatch is for better support of the object model - there's far more context available and this less

[python-win32] Dispatch vs EnsureDispatch performance

2024-04-17 Thread Sven Bardos via python-win32
Hi, shouldn't be EnsureDispatch be faster than Dispatch once the code generation is done? I've measured it by calling 6000 COM calls like this: dirpath = Path('C:/Users/sbardos/AppData/Local/Temp/gen_py/3.10/') if dirpath.exists() and dirpath.is_dir(): shutil.rmtree(dirpath) app = Dispatch(