Return-Path: Delivered-To: apmail-incubator-cassandra-user-archive@minotaur.apache.org Received: (qmail 17810 invoked from network); 27 Oct 2009 18:21:11 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 27 Oct 2009 18:21:11 -0000 Received: (qmail 78290 invoked by uid 500); 27 Oct 2009 18:21:11 -0000 Delivered-To: apmail-incubator-cassandra-user-archive@incubator.apache.org Received: (qmail 78270 invoked by uid 500); 27 Oct 2009 18:21:11 -0000 Mailing-List: contact cassandra-user-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: cassandra-user@incubator.apache.org Delivered-To: mailing list cassandra-user@incubator.apache.org Received: (qmail 78261 invoked by uid 99); 27 Oct 2009 18:21:11 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 27 Oct 2009 18:21:11 +0000 X-ASF-Spam-Status: No, hits=3.4 required=10.0 tests=HTML_MESSAGE,SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (nike.apache.org: local policy) Received: from [72.47.224.12] (HELO n12.c03.server-system.net) (72.47.224.12) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 27 Oct 2009 18:21:00 +0000 Received: from pool-71-104-222-104.lsanca.dsl-w.verizon.net ([71.104.222.104]:50153 helo=iizuu.com) by n12.c03.server-system.net with esmtpa (Exim 4.63) (envelope-from ) id 1N2qeo-0007Ww-I0 for cassandra-user@incubator.apache.org; Tue, 27 Oct 2009 11:20:36 -0700 Content-class: urn:content-classes:message Subject: Performance of get MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----_=_NextPart_001_01CA5732.24FBEA9C" Date: Tue, 27 Oct 2009 11:20:21 -0700 X-MimeOLE: Produced By Microsoft Exchange V6.5 Message-ID: <7FC4BE368A334142B104A2B72F4435AA0452F3@iizuusbs.iizuu.local> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: Performance of get Thread-Index: AcpXMiTEfxbCrLtISNCuwsBAx3OuJw== From: "Christopher McKenzie" To: X-Authenticated-User: 56929 iizuu@dflenterprises.com X-Spam-Level: X-Virus-Checked: Checked by ClamAV on apache.org X-Old-Spam-Status: "score=-0.4 tests=ALL_TRUSTED, HTML_MESSAGE version=3.1.7 cmae=v=1.0 c=1 a=dBnbCCo6mj5+6W1V+KzgIA==:17 a=8pif782wAAAA:8 a=stMDrXVnjdNLanWQ7qwA:9 a=c8iPLp2VFDQp5rTxdjIA:7 a=_oxmyq262RqslXZX-1XPeth8HYwA:4 a=7XkFXCLBsyl-fC4CI5YA:7 a=KTmHr1GxptBRpcT_BvbuzgzqH1QA:4 xcat=Undefined/Undefined" This is a multi-part message in MIME format. ------_=_NextPart_001_01CA5732.24FBEA9C Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hi, I'm kind of new to cassandra. In my application, testing for existence = is quite usual. For instance, someone gives me say, a URL, and if it = doesn't exist, I am ok with that. This will be the usual case. = Existence may only happen like 20% of the time. I was thinking this would be fine, until I saw that the thrift API = *throws and exception* if a key doesn't exist. Checking for existence, a normal control flow operation, requires using = a try/catch method, which are not intended for normal control flow. Many = languages discard the stack when exceptions are thrown and then do = non-local jumps. Other languages will throw the exception to the = operating system (a 'first chance' exception for instance) to be caught = by a debugger if attached. Other languages actually execute an = interrupt on the processor which is a horrible design principle for = normal program flow: http://en.wikipedia.org/wiki/Interrupt. My experience with PHP has shown that interrupts come at a cost of about = 200 times that of a type check. C++ if I recall, on x86/linux was at = least an order of magnitude as well. In Java, it's a bit cheaper, but = there are still faster ways of doing it. Could Get possibly return a reserved value instead? Thanks. ~chris. ------_=_NextPart_001_01CA5732.24FBEA9C Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Performance of get

Hi,

I'm kind of new to cassandra.  In my application, testing for = existence is quite usual.  For instance, someone gives me say, a = URL, and if it doesn't exist, I am ok with that.  This will be the = usual case.  Existence may only happen like 20% of the time.

I was thinking this would be fine, until I saw that the thrift API = *throws and exception* if a key doesn't exist.

Checking for existence, a normal control flow operation, requires using = a try/catch method, which are not intended for normal control flow. Many = languages discard the stack when exceptions are thrown and then do = non-local jumps.  Other languages will throw the exception to the = operating system (a 'first chance' exception for instance) to be caught = by a debugger if attached.  Other languages actually execute an = interrupt on the processor which is a horrible design principle for = normal program flow: http://en.wikipedia.org/w= iki/Interrupt.

My experience with PHP has shown that interrupts come at a cost of about = 200 times that of a type check.  C++ if I recall, on x86/linux was = at least an order of magnitude as well.  In Java, it's a bit = cheaper, but there are still faster ways of doing it.

Could Get possibly return a reserved value instead?

Thanks.

~chris.

------_=_NextPart_001_01CA5732.24FBEA9C--