Return-Path: Delivered-To: apmail-db-derby-dev-archive@www.apache.org Received: (qmail 98349 invoked from network); 1 Sep 2004 19:15:32 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 1 Sep 2004 19:15:32 -0000 Received: (qmail 91755 invoked by uid 500); 1 Sep 2004 19:15:31 -0000 Delivered-To: apmail-db-derby-dev-archive@db.apache.org Received: (qmail 91718 invoked by uid 500); 1 Sep 2004 19:15:31 -0000 Mailing-List: contact derby-dev-help@db.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: list-post: List-Id: "Derby Development" Reply-To: "Derby Development" Delivered-To: mailing list derby-dev@db.apache.org Received: (qmail 91707 invoked by uid 99); 1 Sep 2004 19:15:31 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: neutral (hermes.apache.org: local policy) Received: from [62.24.64.34] (HELO smtp.dkm.cz) (62.24.64.34) by apache.org (qpsmtpd/0.28) with SMTP; Wed, 01 Sep 2004 12:15:29 -0700 Received: (qmail 31922 invoked by uid 0); 1 Sep 2004 19:15:26 -0000 Received: from lin.code.cz (HELO ?192.168.0.2?) (62.245.69.249) by smtp.dkm.cz with SMTP; 1 Sep 2004 19:15:26 -0000 Message-ID: <4136201C.2070501@code.cz> Date: Wed, 01 Sep 2004 21:16:44 +0200 From: =?ISO-8859-1?Q?Jan_Hlavat=FD?= User-Agent: Mozilla Thunderbird 0.7.3 (Windows/20040803) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Derby Development Subject: Re: [PATCH] Optimization of org.apache.derby.impl.services.uuid.BasicUUID.toByteArray() References: <41355B80.5010902@code.cz> <4135FACA.9050506@debrunners.com> In-Reply-To: <4135FACA.9050506@debrunners.com> X-Enigmail-Version: 0.85.0.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Daniel John Debrunner wrote: | Jan Hlavat� wrote: | | | Removed unnecessary &'s (these are done automatically by conversion to | | byte). | | Saves 32 bytecode instructions as well as several long constants in the | | classfile, | | and should run a bit faster. | | I think you are correct, but I also have a very vague memory of some | issues if we didn't use the &'s. There are issues with sign extension when doing it the other way around (stuffing bytes to int/long) - thats when you need ands. Maybe thats what is haunting you ;) | I know this is early code and we | (Cloudscape engineers) were following the examples from Sun, e.g. look | at this extract from the Javadoc for java.io.DataOutput.writeShort. | | http://java.sun.com/j2se/1.4.2/docs/api/java/io/DataOutput.html#writeShort(int) | | | The byte values to be written, in the order shown, are: | | ~ (byte)(0xff & (v >> 8)) | ~ (byte)(0xff & v) Well I can't make any sense of it... why the hell would they and with 0xff? Do they have bytes larger than 8 bits or something ;) Or maybe its just braindead code ;) Jan -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (MingW32) Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org iQEVAwUBQTYgHHFDePgyse5HAQKqIAgAjaX+pm6t0iXzOod4pHI0sySh8FqdIML+ luTRpPqAjLaHT6L6+xPh210J2KRn3ASUpIpch0DruY3NKsBkk38DMQ9wjevh6imq 7/ahWtSe1ISPstYjFxBRwavJF4uK412TsW5sJ4NhIZGMSnvq8JGQPfNvAKRqCxEZ nkbAsy1ADcHpQtYhSDiMv97rNGWmBqbsBP2QaTcJrciWHjdJxh4/z+JM5jtshefa /SuCvYcnkU6puw+jVBIfV+hf96WETQ8bzatMA/nw23VSHH0YUT4YYDs+aiCfYKce 2yf/4anxPSGWS5Y+5i0YIF7cc1xGtt3fCKN8NSI3aBEdAY0qkZfnmA== =SnyD -----END PGP SIGNATURE-----