Return-Path: X-Original-To: apmail-couchdb-user-archive@www.apache.org Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id D196B815E for ; Fri, 12 Aug 2011 04:50:23 +0000 (UTC) Received: (qmail 2942 invoked by uid 500); 12 Aug 2011 04:50:21 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 2138 invoked by uid 500); 12 Aug 2011 04:50:04 -0000 Mailing-List: contact user-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@couchdb.apache.org Delivered-To: mailing list user@couchdb.apache.org Received: (qmail 2115 invoked by uid 99); 12 Aug 2011 04:49:55 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 12 Aug 2011 04:49:55 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of paul.joseph.davis@gmail.com designates 209.85.220.180 as permitted sender) Received: from [209.85.220.180] (HELO mail-vx0-f180.google.com) (209.85.220.180) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 12 Aug 2011 04:49:49 +0000 Received: by vxh15 with SMTP id 15so3377090vxh.11 for ; Thu, 11 Aug 2011 21:49:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type:content-transfer-encoding; bh=aBeg//chtGB2eDlLBwzJakek6VAiiAO7J21tx67QvCA=; b=AOZTWWaLP9Xz2NBiakiCC5zhJyLaJmUQ/rshwf44O1iTZn7RTVVf3FYdg6tjXGMxsy yek+JP2SSGrPZTC4FVS4yHPuDPFdNL6LMS/nOacqSQTYuW4vJkO4dZduZ0jJjD3BMHxF SgyZzMszTvgEQaG+4Pfr/egWaP7LyqQklabXE= Received: by 10.52.182.164 with SMTP id ef4mr447571vdc.319.1313124569076; Thu, 11 Aug 2011 21:49:29 -0700 (PDT) MIME-Version: 1.0 Received: by 10.52.168.130 with HTTP; Thu, 11 Aug 2011 21:48:49 -0700 (PDT) In-Reply-To: References: From: Paul Davis Date: Thu, 11 Aug 2011 23:48:49 -0500 Message-ID: Subject: Re: Bulk update performance with validation functions To: user@couchdb.apache.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On Thu, Aug 11, 2011 at 4:18 PM, Max Ogden wrote: > =A0I'm wondering if anyone has a solution for the huge bulk_docs performa= nce > hit incurred when using javascript validate_doc_update functions ~100k do= cs > (2.6MB of json) =A0 =A0log_level info without validation: 0m2.663s > =A0log_level info and validation: 0m30.778s (yes, it went from 2 seconds = to 30 > seconds when I added a validation function) =A0 =A0validation function: > ddoc.validate_doc_update > =3D function (newDoc, oldDoc, userCtx) { if (newDoc._deleted =3D=3D=3D tr= ue && > userCtx.roles.indexOf('_admin') =3D=3D=3D -1) { throw "Only admin can del= ete > documents on this database."; } }; is it possible to write these function= s > in erlang? max > Its been awhile since I peeped the erlang code for this, but maybe? Also, you tried this on trunk with the new JSON parser improvements?