Heesob Park
6/9/2009 2:21:00 PM
Hi,
2009/6/9 Sandeep Gupta <sandeep.gupta@subexworld.com>:
> Hi all,
>
> I generated ruby profile for my test suite. In my profile i observed
> that 10% of my test time is taken by WIN32OLE#method_missing. It was
> called 60077 times.
>
> Can anyone please help me understand when and why it is getting called.
> Is there any way to optimize it ?
>
That is the way WIN32OLE work. All properties and methods pass through
method_missing.
The C code can be written with Ruby code like this:
def method_missing(id,*args)
method = id.to_s
if method[-1] == ?=
method = method[0..-2]
return ole_propertyput(method,args.first)
else
return ole_invoke(method, args, DISPATCH_METHOD|DISPATCH_PROPERTYGET, false)
end
end
Regards,
Park Heesob