From owner-freebsd-performance@FreeBSD.ORG Fri Feb 8 20:15:33 2008 Return-Path: Delivered-To: freebsd-performance@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E358116A419; Fri, 8 Feb 2008 20:15:33 +0000 (UTC) (envelope-from cswiger@mac.com) Received: from mail-out3.apple.com (mail-out3.apple.com [17.254.13.22]) by mx1.freebsd.org (Postfix) with ESMTP id C312213C4E3; Fri, 8 Feb 2008 20:15:33 +0000 (UTC) (envelope-from cswiger@mac.com) Received: from relay12.apple.com (relay14.apple.com [17.128.113.52]) by mail-out3.apple.com (Postfix) with ESMTP id DC0DB2096DE2; Fri, 8 Feb 2008 11:56:54 -0800 (PST) Received: from relay14.apple.com (unknown [127.0.0.1]) by relay12.apple.com (Symantec Mail Security) with ESMTP id C239228089; Fri, 8 Feb 2008 11:56:54 -0800 (PST) X-AuditID: 11807134-a7d7cbb0000008b9-fc-47acb4063019 Received: from cswiger1.apple.com (cswiger1.apple.com [17.214.13.96]) by relay12.apple.com (Apple SCV relay) with ESMTP id A0A5D28086; Fri, 8 Feb 2008 11:56:54 -0800 (PST) Message-Id: <9D27D745-2465-4FB2-B7E0-3C5DD411E9B9@mac.com> From: Chuck Swiger To: Ivan Voras In-Reply-To: Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v915) Date: Fri, 8 Feb 2008 11:56:54 -0800 References: <4796C717.9000507@cederstrand.dk> <20080123193400.N63024@fledge.watson.org> <4797A245.7080202@cederstrand.dk> <20080123202433.E63024@fledge.watson.org> <4797A802.8060509@FreeBSD.org> <47A0BFE7.4070708@cederstrand.dk> <20080130190000.GA18333@lor.one-eyed-alien.net> <47AC15A5.5020009@cederstrand.dk> <20080208151756.GA35423@lor.one-eyed-alien.net> X-Mailer: Apple Mail (2.915) X-Brightmail-Tracker: AAAAAA== Cc: freebsd-performance@freebsd.org Subject: Re: Performance Tracker project update X-BeenThere: freebsd-performance@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Performance/tuning List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Feb 2008 20:15:34 -0000 On Feb 8, 2008, at 11:42 AM, Ivan Voras wrote: >> I'm not a python guru by any means, but I think .pyc files probably >> have data >> about the .py they are generated from because there's some sort of >> auto-generation available. It may be possible to not store them at >> all and >> just generate them before you use them or add some magic build >> flags to cause >> them to store some sort of cooked values. I'm not sure where >> the .pyo files >> come from. > > .pyc/.pyo contain at least the timestamp of the original .py file > and maybe a compilation timestamp. You can indeed safely delete > all .pyc and .pyo files and forget about them - the only penalty > will be slightly slower application startup times as the .py files > are compiled every time. Yep, that's right. > .pyo are optimized version of .pyc. AFAIK currently the > optimizations are not worth it. Historically, the Python optimizer wasn't capable of doing much, true, but the more recent versions of the optimizer can actually do some peephole optimizations like algorithmic simplification and constant folding: http://docs.python.org/whatsnew/other-lang.html#SECTION0001320000000000000000 -- -Chuck