From: Jeremy W. <jez...@ho...> - 2005-10-23 11:49:27
|
Hi, The typemap for T_HANDLE is as follows: if(SvROK($arg)) { if(hv_fetch((HV*)SvRV($arg), \"-handle\", 7, 0) != NULL) $var = ($type) SvIV(*(hv_fetch((HV*)SvRV($arg), \"-handle\", 7, 0))); else $var = NULL; } else $var = ($type) SvIV($arg); which becomes: if(SvROK(ST(0))) { if(hv_fetch((HV*)SvRV(ST(0)), "-handle", 7, 0) != NULL) handle = (HWND) SvIV(*(hv_fetch((HV*)SvRV(ST(0)), "-handle", 7, 0))); else handle = NULL; } else handle = (HWND) SvIV(ST(0)); in the code. If I am understanding this correctly we are doing 2 hash reads where we really only need to do one. As this typemap is used in nearly every method call we are doing lots of hash reads needlessly. Thoughts? Cheers, jez. |