From: Jeremy W. <jez...@ho...> - 2005-10-24 08:47:04
|
Just done some performance testing with this type map: if(SvROK($arg)) { SV** out=hv_fetch((HV*)SvRV($arg), \"-handle\", 7, 0); if(out != NULL) $var = ($type) SvIV(*out); else $var = NULL; } else $var = ($type) SvIV($arg); Benchmark: timing 1000000 iterations of NewTypeMap, OldTypeMap... NewTypeMap: 29 wallclock secs (29.64 usr + 0.06 sys = 29.70 CPU) @ 33666.63/s ( n=1000000) OldTypeMap: 38 wallclock secs (38.22 usr + 0.02 sys = 38.23 CPU) @ 26154.05/s ( n=1000000) Thoughts? Cheers, jez. |