Re: enum/flag package registration? (was Re: Missing pango constants)



On Tuesday, July 29, 2003, at 11:51  AM, muppet wrote:

/me wracks brain trying to figure out how to solve this specific problem
without incurring a performance hit on the general case

well, i did some extremely scientific tests, comparing 1000 reps of 'perl -e "use Gtk2;"' with a build of gtk2-perl that doesn't register the extra enum and flag types with a build that does... i didn't find a difference. both builds took 0.04s to 0.05s per rep on my 2GHz machine. theoretically, there should be an increase of about 3k in memory footprint, but i couldn't actually measure it.

and what's even better, the change is confined to the Gtk2::CodeGen module, which now generates a gperl_register_fundamental call in register.xsh for each GEnum and GFlags type in the maps file. i know these aren't really fundamentals, but from the perl level there's really no difference, and it keeps us from having yet another private hash table.

so, you can use the package name of any GEnum or GFlags as a column type, as i was describing in the previous message.

just committed this to cvs, you'll see it in tomorrow's 0.92 release.




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]