Return-Path: X-Original-To: apmail-couchdb-dev-archive@www.apache.org Delivered-To: apmail-couchdb-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id A8FD51037B for ; Tue, 3 Dec 2013 21:10:36 +0000 (UTC) Received: (qmail 66865 invoked by uid 500); 3 Dec 2013 21:10:35 -0000 Delivered-To: apmail-couchdb-dev-archive@couchdb.apache.org Received: (qmail 66816 invoked by uid 500); 3 Dec 2013 21:10:35 -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 66768 invoked by uid 99); 3 Dec 2013 21:10:35 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 03 Dec 2013 21:10:35 +0000 Date: Tue, 3 Dec 2013 21:10:35 +0000 (UTC) From: "Nick North (JIRA)" To: dev@couchdb.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (COUCHDB-1953) Speed up parsing of multipart/related requests 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-1953?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13838192#comment-13838192 ] Nick North commented on COUCHDB-1953: ------------------------------------- I got a factor of four improvement in parsing in simple tests on a Windows installation. It depends on the attachment contents: if your attachment has a lot of "--" instances, then the current algorithm could be dramatically slower as it will keep matching them and repeatedly rescanning parts of the input. > Speed up parsing of multipart/related requests > ---------------------------------------------- > > Key: COUCHDB-1953 > URL: https://issues.apache.org/jira/browse/COUCHDB-1953 > Project: CouchDB > Issue Type: Improvement > Components: HTTP Interface > Reporter: Nick North > > Parsing of multipart/related requests searches for the MIME boundary string using the couch_httpd:find_in_binary/2 function, which can be made more efficient. > When the boundary string is not found in its entirety in the search data, the function should then look to see if the data ends with a prefix of the string, but it currently looks for any prefix of the string almost anywhere in the search data. > A pull request to fix this will be submitted shortly. -- This message was sent by Atlassian JIRA (v6.1#6144)