Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!news.albasani.net!news.stack.nl!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.011 X-Spam-Evidence: '*H*': 0.98; '*S*': 0.00; 'ram': 0.05; 'python': 0.08; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:80.91.229.12': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'received:lo.gmane.org': 0.09; 'am,': 0.12; 'developer': 0.12; 'from:addr:behnel.de': 0.16; 'from:addr:stefan_ml': 0.16; 'from:name:stefan behnel': 0.16; 'wrote:': 0.16; 'memory': 0.21; 'process,': 0.21; 'header:In- Reply-To:1': 0.22; 'there.': 0.24; 'aug': 0.24; 'xml': 0.25; 'thu,': 0.28; 'correct': 0.28; 'server': 0.29; 'oracle': 0.29; 'order.': 0.29; 'stefan': 0.29; 'module': 0.30; 'strings.': 0.30; 'seem': 0.31; 'chris': 0.32; 'probably': 0.33; 'to:addr:python- list': 0.33; 'header:User-Agent:1': 0.34; 'option.': 0.34; 'subject: ?': 0.34; 'weird': 0.34; 'header:X-Complaints-To:1': 0.35; 'rather': 0.35; 'problem.': 0.36; 'another': 0.37; 'using': 0.37; 'put': 0.37; 'several': 0.37; 'think': 0.38; 'received:org': 0.38; 'easiest': 0.38; 'subject:: ': 0.39; 'under': 0.39; 'header :Mime-Version:1': 0.39; "there's": 0.39; 'data': 0.39; 'why': 0.39; 'to:addr:python.org': 0.39; 'course.': 0.63; 'guarantee': 0.66; '11,': 0.68; 'flow': 0.68; 'carefully': 0.68; 'received:188': 0.68; 'soon.': 0.71; 'submission': 0.71; '256': 0.84 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Stefan Behnel Subject: Re: String concatenation - which is the fastest way ? Date: Thu, 11 Aug 2011 13:59:50 +0200 References: <20110810111754.GD5045@host.pgf.com.pl> <20110810133146.GE5045@host.pgf.com.pl> <20110811064030.GB4990@host.pgf.com.pl> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Gmane-NNTP-Posting-Host: ppp-188-174-121-194.dynamic.mnet-online.de User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.18) Gecko/20110617 Lightning/1.0b2 Thunderbird/3.1.11 In-Reply-To: X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 26 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1313064009 news.xs4all.nl 23861 [2001:888:2000:d::a6]:59797 X-Complaints-To: abuse@xs4all.nl Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:11208 Chris Angelico, 11.08.2011 12:59: > On Thu, Aug 11, 2011 at 7:40 AM, wrote: >> I am not a database developer so I don't want to change the whole process >> of data flow between applications in my company. Another process is >> reading this XML from particular Oracle table so I have to put the final XML there. > > I think you may be looking at a submission to > http://www.thedailywtf.com/ soon. You seem to be working in a rather > weird dataflow. :( Under the circumstances, you're probably going to > want to go with the original ''.join() option. > >> This server has 256 GB of RAM so memory is not a problem. >> Also the select which fetches the data is sorted. That is why I have to >> carefully divide into subtasks and then merge it in correct order. > > There's no guarantee that all of that 256GB is available to you, of course. > > What may be the easiest way is to do the select in a single process, > then partition it and use the Python multiprocessing module to split > the job into several parts. Then you need only concatenate the handful > of strings. Or join them using an n-way merge. Stefan