Return-Path: Delivered-To: apmail-couchdb-dev-archive@www.apache.org Received: (qmail 14416 invoked from network); 4 Mar 2010 12:28:04 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 4 Mar 2010 12:28:04 -0000 Received: (qmail 36023 invoked by uid 500); 4 Mar 2010 12:27:53 -0000 Delivered-To: apmail-couchdb-dev-archive@couchdb.apache.org Received: (qmail 35978 invoked by uid 500); 4 Mar 2010 12:27:53 -0000 Mailing-List: contact dev-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@couchdb.apache.org Delivered-To: mailing list dev@couchdb.apache.org Received: (qmail 35970 invoked by uid 99); 4 Mar 2010 12:27:53 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 04 Mar 2010 12:27:53 +0000 X-ASF-Spam-Status: No, hits=-1998.5 required=10.0 tests=ALL_TRUSTED,NORMAL_HTTP_TO_IP,WEIRD_PORT X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 04 Mar 2010 12:27:47 +0000 Received: from brutus.apache.org (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 3FFA7234C4C9 for ; Thu, 4 Mar 2010 12:27:27 +0000 (UTC) Message-ID: <1400303738.66781267705647261.JavaMail.jira@brutus.apache.org> Date: Thu, 4 Mar 2010 12:27:27 +0000 (UTC) From: "Filipe Manana (JIRA)" To: dev@couchdb.apache.org Subject: [jira] Updated: (COUCHDB-681) couch_util:encodeBase64 vs base64:encode In-Reply-To: <1362385673.66761267705647244.JavaMail.jira@brutus.apache.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/COUCHDB-681?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Filipe Manana updated COUCHDB-681: ---------------------------------- Attachment: base64-trunk.patch > couch_util:encodeBase64 vs base64:encode > ---------------------------------------- > > Key: COUCHDB-681 > URL: https://issues.apache.org/jira/browse/COUCHDB-681 > Project: CouchDB > Issue Type: Improvement > Components: Infrastructure > Environment: trunk and all other branches > Reporter: Filipe Manana > Attachments: base64-trunk.patch > > > Just noticed that OTP's base64:encode is about one order of magnitude faster than couch_util:encodeBase64: > fdmanana@core2duo:~/git/couchdb/bin$ ./couchdb -i > Erlang R13B03 (erts-5.7.4) [source] [64-bit] [smp:2:2] [rq:2] [async-threads:0] [hipe] [kernel-poll:true] > Eshell V5.7.4 (abort with ^G) > 1> Apache CouchDB 0.11.0bd318717-git (LogLevel=info) is starting. > Apache CouchDB has started. Time to relax. > [info] [<0.37.0>] Apache CouchDB has started on http://127.0.0.1:5984/ > 1> L = crypto:rand_bytes(1024 * 1024). > <<10,238,241,237,52,176,52,252,99,133,199,63,177,68,141, > 24,225,251,115,187,34,143,152,253,150,170,9,122,0,...>> > 2> > 2> timer:tc(couch_util, encodeBase64, [L]). > {368052, > <<"Cu7x7TSwNPxjhcc/sUSNGOH7c7sij5j9lqoJegDoP07QyKeuCeMtWD7aXcW0junYH1csNda3F83owKQDw6D8pI+Ep0A231BD2sMEYF0XFkCW"...>>} > 3> timer:tc(couch_util, encodeBase64, [L]). > {361919, > <<"Cu7x7TSwNPxjhcc/sUSNGOH7c7sij5j9lqoJegDoP07QyKeuCeMtWD7aXcW0junYH1csNda3F83owKQDw6D8pI+Ep0A231BD2sMEYF0XFkCW"...>>} > 4> timer:tc(couch_util, encodeBase64, [L]). > {361141, > <<"Cu7x7TSwNPxjhcc/sUSNGOH7c7sij5j9lqoJegDoP07QyKeuCeMtWD7aXcW0junYH1csNda3F83owKQDw6D8pI+Ep0A231BD2sMEYF0XFkCW"...>>} > 5> > 5> timer:tc(base64, encode, [L]). > {91055, > <<"Cu7x7TSwNPxjhcc/sUSNGOH7c7sij5j9lqoJegDoP07QyKeuCeMtWD7aXcW0junYH1csNda3F83owKQDw6D8pI+Ep0A231BD2sMEYF0XFkCW"...>>} > 6> timer:tc(base64, encode, [L]). > {107130, > <<"Cu7x7TSwNPxjhcc/sUSNGOH7c7sij5j9lqoJegDoP07QyKeuCeMtWD7aXcW0junYH1csNda3F83owKQDw6D8pI+Ep0A231BD2sMEYF0XFkCW"...>>} > 7> timer:tc(base64, encode, [L]). > {96070, > <<"Cu7x7TSwNPxjhcc/sUSNGOH7c7sij5j9lqoJegDoP07QyKeuCeMtWD7aXcW0junYH1csNda3F83owKQDw6D8pI+Ep0A231BD2sMEYF0XFkCW"...>>} > Same goes for base64:decode vs couch_util:decodeBase64 > Therefore I supply a patch to do the switch. > It also allows us to short a little couch_util :) > I executed all tests, both Etap and JS, and everything is fine with the switch. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.