Re: Standalone Pango, take two



muppet wrote:
• Performance: 'use Gtk2' got 3% slower on my machine. (That is, 'use Gtk2' now takes 1.03 times the time it takes without the patch.) Should we worry about that?

That's not very much, and it's undoubtedly due to the added seeks & DSO load for Pango.so, as well as the API fixups.

The obvious fix would be lazy-loading, which might actually be a win for lots of programs. After all, you don't *have* to call Pango functions in your user code to have a useful Gtk2 app.

The trick would be figuring out how to defer loading Pango.pm (and the corresponding Pango.so) until actually needed. That starts to sound like more complexity than warranted for fixing a 3% slowdown.

Yeah, I agree.

 perl -MPango -le'map { print } keys %Pango::' | sort

More importantly even, the loop will also automatically map over any new API we add to Pango, thus indirectly changing Gtk2's API. Is it better to hardcode the stuff that should be mapped over?

That's not a feature?  ;-)

The hardcoded list would effectively freeze the Gtk2::Pango API, which might be a good idea.

I converted the loop to use a hardcoded list now.

• The yellow-wiring foreach loop somehow makes these two evaluate to true:

 Pango::Layout->isa (Gtk2::Pango::Layout::)
 Gtk2::Pango::Layout->isa (Pango::Layout::)

I don't understand why or how it does that. Is that a mechanism we can rely on? It is important that the two expressions are true for backwards compatibility. (I tested it with perl 5.8.8, 5.10.0, and blead -- it seems to work fine in every case.)


If i'm reading the globbing expression correctly, it looks like putting the same references in both symbol tables instead of just copying.

Yes, and somehow this makes the isa() algorithm think that both packages are equivalent. I asked about this on the module-authors list: <http://www.mail-archive.com/module-authors perl org/msg06814.html>. The mail also contains a small example program that uses no modules.

s/relevent/relevant/g in the pod.

Fixed.

-Torsten



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