From owner-freebsd-python@FreeBSD.ORG  Fri Mar  5 17:34:38 2004
Return-Path: <owner-freebsd-python@FreeBSD.ORG>
Delivered-To: freebsd-python@freebsd.org
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP
	id 0841916A4CF; Fri,  5 Mar 2004 17:34:38 -0800 (PST)
Received: from miffy.openlook.org (openlook.org [211.236.182.73])
	by mx1.FreeBSD.org (Postfix) with ESMTP
	id 85AA343D1F; Fri,  5 Mar 2004 17:34:37 -0800 (PST)
	(envelope-from perky@miffy.openlook.org)
Received: by miffy.openlook.org (Postfix, from userid 1000)
	id AD8A9A966; Sat,  6 Mar 2004 10:23:03 +0900 (KST)
Date: Sat, 6 Mar 2004 10:23:03 +0900
From: Hye-Shik Chang <perky@i18n.org>
To: Tim Middleton <x@Vex.Net>
Message-ID: <20040306012303.GA34589@i18n.org>
References: <20040305101837.GA78274@i18n.org> <200403051742.26067.x@Vex.Net>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <200403051742.26067.x@Vex.Net>
X-Accept-Language: ko, en
User-Agent: Mutt/1.5.5.1i
cc: John Hay <jhay@icomtek.csir.co.za>
cc: python@freebsd.org
cc: Dima Dorfman <dd@FreeBSD.org>
Subject: Re: Python patch to install a shared library
X-BeenThere: freebsd-python@freebsd.org
X-Mailman-Version: 2.1.1
Precedence: list
List-Id: FreeBSD-specific Python issues <freebsd-python.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/listinfo/freebsd-python>,
	<mailto:freebsd-python-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/freebsd-python>
List-Post: <mailto:freebsd-python@freebsd.org>
List-Help: <mailto:freebsd-python-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/freebsd-python>,
	<mailto:freebsd-python-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Sat, 06 Mar 2004 01:34:38 -0000

On Fri, Mar 05, 2004 at 05:42:26PM -0500, Tim Middleton wrote:
> On Friday 05 March 2004 05:18, Hye-Shik Chang wrote:
> > Please test this patch on your platform:
> >  http://people.freebsd.org/~perky/pyshared.diff
> 
> It's been quite a while since i tried BUILD_SHARED on a -CURRENT box (I had 
> problems with it last time I tried... quite a long time ago, if i recall 
> correctly). I always BUILD_SHARED on -STABLE boxes these days though, and it 
> works great.
> 
> I've built with this patch on the -CURRENT box i'm now typing on (ordinary 
> i386), and it appears to be working nicely so far. Looks good to me.

Thanks for the testing.

> I wonder if the BUILD_SHARED knob should not be kept though. It seems this 
> patched port installs static as bin/python[2.3] ... along with 
> bin/python-shared[2.3]. But people who are used to BUILD_SHARED probably 
> won't expect bin/python now to be a non-shared version, which they then will 
> have to overwrite with the shared version manually. 

Because static one is faster than shared because of PIC optimization
and some others. See:

% python /usr/local/lib/python2.3/test/pystone.py
Pystone(1.1) time for 50000 passes = 2.67188
This machine benchmarks at 18713.5 pystones/second
% python-shared /usr/local/lib/python2.3/test/pystone.py
Pystone(1.1) time for 50000 passes = 3.27344
This machine benchmarks at 15274.5 pystones/second

I think python-shared isn't useful as libpython2.3.so and the only
case when python-shared is useful will be this:

 python-shared -> xyzmodule.so extension module -> libxyz.so -> libpython2.3.so
 (where libxyz.so is doing both of extending and embedding)

> Perhaps if BUILD_SHARED is specified then bin/python will be the shared 
> binary; and bin/python-static[2.3] would also be placed. But this is starting 
> to get confusing... maybe it should always install python-static and 
> python-shared ... and the knob just control which is copied to plain 
> bin/python. 
> 
> Well, just my observations anyhow. Doesn't really matter to me. 

Yes. It's too confusing. If anyone really wants to make his bin/python
as shared binary, I will consider this again then. :)

Thanks!


Regards,
Hye-Shik