Re: CSV Generation MEMORY SUCK

2008-06-04 Thread Rick Root
This whole discussion prompted two blog entries... Regarding the javaCSV library: http://www.opensourcecf.com/1/2008/06/JavaCSV-for-creating-large-CSV-and-other-delmiited-files-with-Coldfusion.cfm *or http://tinyurl.com/58o7ox* ** Regarding my cfsavecontent performance tests:

RE: CSV Generation MEMORY SUCK

2008-06-04 Thread Brad Wood
To: CF-Talk Subject: RE: CSV Generation MEMORY SUCK (Sorry, I got a little CTRL-Enter happy and sent before I was ready...) Building up strings in cfsavecontent also concatenates to the result variable so the problem is the same. = Hmm, I don't think

Re: CSV Generation MEMORY SUCK

2008-06-04 Thread Larry Lyons
This whole discussion prompted two blog entries... Regarding the javaCSV library: http://www.opensourcecf. com/1/2008/06/Ja vaCSV-for-creating-large-CSV-and-other-delmiited-files-with-Coldfusion. cfm *or http://tinyurl.com/58o7ox* ** Regarding my cfsavecontent performance tests:

RE: CSV Generation MEMORY SUCK

2008-06-04 Thread Brad Wood
That's pretty cool, Larry. I was wondering about BD and Smith. Will J2EE BD let you create the java.lang.runtime object to get memory usage etc? If so, I would be interested in seeing the results of my version of the test which reported the memory increase for each test. (I posted the code

Re: CSV Generation MEMORY SUCK

2008-06-04 Thread Larry Lyons
Here are the results of your code (again BD for J2EE running on JBoss AS 4.22): string string: 33251ms String Length: 39 cfsavecontent: 62ms String Length: 570006 I ran the test several times, mainly because the results for cfsavecontent looked so much like an outlier, but I got similar

Re: CSV Generation MEMORY SUCK

2008-06-04 Thread Larry Lyons
Here are the results of your code with java.lang.runtime. Forgot to mention that the JVM is 1.5.0_15-b04. Memory Before: 28 Megs string string: 99642ms String Length: 65 Memory After: 91 Megs -- Increase of 63 Megs Memory Before: 29 Megs cfsavecontent: 63ms String Length: 850003 Memory

Re: CSV Generation MEMORY SUCK

2008-06-04 Thread Larry Lyons
Just ran the same code on Open BlueDragon. NThis test probably is not the equivalent of the previous tests, at home here I'm running this app on a MacBook (core duo 2.16 ghz with 2 gb RAM), running OSX 10.4 Tiger. J2SE 5. But the results are similar: Memory Before: 26 Megs string string:

RE: CSV Generation MEMORY SUCK

2008-06-04 Thread Brad Wood
Thanks Larry. ~Brad -Original Message- From: Larry Lyons [mailto:[EMAIL PROTECTED] Sent: Wednesday, June 04, 2008 1:34 PM To: CF-Talk Subject: Re: CSV Generation MEMORY SUCK Here are the results of your code with java.lang.runtime. Forgot to mention that the JVM is 1.5.0_15-b04

Re: CSV Generation MEMORY SUCK

2008-06-03 Thread Tom Chiverton
On Monday 02 Jun 2008, Rick Root wrote: I found a nice little java class library called JavaCSV that handles all the file writing and dropped my time from 68 seconds to 18 seconds. That has potential! Why CF can't translate '' to a StringBuffer append I'll never know... -- Tom Chiverton

RE: CSV Generation MEMORY SUCK

2008-06-03 Thread Brad Wood
- From: Brian Kotek [mailto:[EMAIL PROTECTED] Sent: Tuesday, June 03, 2008 10:12 AM To: CF-Talk Subject: Re: CSV Generation MEMORY SUCK Probably because it can't know if that's what you actually want to do. We probably need a new function StringAppend or something that would be able to do this. Might

Re: CSV Generation MEMORY SUCK

2008-06-03 Thread Tom Chiverton
On Tuesday 03 Jun 2008, Brian Kotek wrote: Probably because it can't know if that's what you actually want to do. We probably need a new function StringAppend or something that would be able to do this. Might be time to hit the wish list! ;-) I'm leaving for Scotch on the Rocks in ~12 hours,

Re: CSV Generation MEMORY SUCK

2008-06-03 Thread Brian Kotek
Probably because it can't know if that's what you actually want to do. We probably need a new function StringAppend or something that would be able to do this. Might be time to hit the wish list! ;-) On Tue, Jun 3, 2008 at 4:36 AM, Tom Chiverton [EMAIL PROTECTED] wrote: On Monday 02 Jun 2008,

Re: CSV Generation MEMORY SUCK

2008-06-03 Thread Brian Kotek
Generation MEMORY SUCK Probably because it can't know if that's what you actually want to do. We probably need a new function StringAppend or something that would be able to do this. Might be time to hit the wish list

RE: CSV Generation MEMORY SUCK

2008-06-03 Thread Brad Wood
Good to know. What is your source of this information? ~Brad From: Brian Kotek [mailto:[EMAIL PROTECTED] Sent: Tuesday, June 03, 2008 11:11 AM Building up strings in cfsavecontent also concatenates to the result variable so the problem is the same. On Tue, Jun 3, 2008 at 11:16 AM, Brad

Re: CSV Generation MEMORY SUCK

2008-06-03 Thread Wil Genovese
where a fair chunk of the CF9 team are hosting a BOF session :-) That was a fun and ruckus BOF session at CF.Objective()! Wil Genovese ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get

RE: CSV Generation MEMORY SUCK

2008-06-03 Thread Brad Wood
Hmm, I don't think you are correct Brian. I just whipped up a test of string concatenation. Please spare the proper load test flames. This is NOT a load test-- it is intended to make a process run long enough to capture a thread stack. Actually, in the context of large file generations I

RE: CSV Generation MEMORY SUCK

2008-06-03 Thread Brad Wood
-Original Message- From: Brad Wood Sent: Tuesday, June 03, 2008 11:45 AM To: Brad Wood; 'cf-talk@houseoffusion.com' Subject: RE: CSV Generation MEMORY SUCK Here are the results: string string: 17093ms String Length: 39 cfsavecontent: 125ms String Length: 39

Re: CSV Generation MEMORY SUCK

2008-06-03 Thread Gerald Guido
a slower server too! string string: 9141ms String Length: 39 cfsavecontent: 31ms String Length: 39 -Original Message- From: Brad Wood Sent: Tuesday, June 03, 2008 11:45 AM To: Brad Wood; 'cf-talk@houseoffusion.com' Subject: RE: CSV Generation MEMORY SUCK Here are the results

RE: CSV Generation MEMORY SUCK

2008-06-03 Thread Brad Wood
PM To: CF-Talk Subject: Re: CSV Generation MEMORY SUCK Did you compare the memory usage by chance? G On Tue, Jun 3, 2008 at 1:07 PM, Brad Wood [EMAIL PROTECTED] wrote: ~| Adobe® ColdFusion® 8 software 8 is the most important

RE: CSV Generation MEMORY SUCK

2008-06-03 Thread Brad Wood
Ok, here are my memory usage stats on CF 7. Someone please correct me if my code is wrong. It's a little messy, and I apologize for that. Memory Before: 83 Megs string string: 52795ms String Length: 65 Memory After: 101 Megs -- Increase of 17 Megs Memory Before: 85 Megs cfsavecontent:

Re: CSV Generation MEMORY SUCK

2008-06-03 Thread Gerald Guido
I did a million loops - I don't know what possessed me to do that. Memory was measured using task manager. Totally unscientific. I did a restart on the service before each trial. CF 8 developer 2 gig ram Java v. 1.6.0_01 cfsavecontent 2281 ms 192,356 k start 260,872K after 68.516 k difference

Re: CSV Generation MEMORY SUCK

2008-06-03 Thread Rick Root
Wow, I just came back to this thread. REALLY makes me wonder how they're handling cfsavecontent! ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial

RE: CSV Generation MEMORY SUCK

2008-06-03 Thread Brad Wood
+10=55 For the life of me I can't figure out what the Big-O notation would be for that though... ~Brad -Original Message- From: Gerald Guido [mailto:[EMAIL PROTECTED] Sent: Tuesday, June 03, 2008 1:44 PM To: CF-Talk Subject: Re: CSV Generation MEMORY SUCK I did a million loops - I don't

Re: CSV Generation MEMORY SUCK

2008-06-03 Thread Rick Root
Well, since we're all conducting our own little tests, here's MY test code: the cfset method took 64 seconds. The cfsavecontent method only takes 203ms. It has GOT to be using a stringbuffer then converting the result to a string at the end. cfsetting enablecfoutputonly=yes cfsetting

RE: CSV Generation MEMORY SUCK

2008-06-03 Thread Brad Wood
Dang closed source apps-- if only we could just go look at the code! :) ~Brad -Original Message- From: Rick Root [mailto:[EMAIL PROTECTED] Sent: Tuesday, June 03, 2008 2:26 PM To: CF-Talk Subject: Re: CSV Generation MEMORY SUCK Well, since we're all conducting our own little tests

Re: CSV Generation MEMORY SUCK

2008-06-03 Thread Brian Kotek
Just experience, since I've tried all three options (concatenation, cfsavecontent, and StringBuffer) and have had the first two generate out of memory errors while the StringBuffer worked correctly. So while cfsavecontent may indeed be faster and use less memory, I'm still pretty sure that the

Re: CSV Generation MEMORY SUCK

2008-06-03 Thread Gerald Guido
Just a 411 I found a nice little tute on generating csv's using the StringBuffer class in ColdFusion http://www.stillnetstudios.com/2007/03/07/java-strings-in-coldfusion/ -- The important thing in science is not so much to obtain new facts as to discover new ways of thinking about them. - Sir

RE: CSV Generation MEMORY SUCK

2008-06-03 Thread Brad Wood
(Sorry, I got a little CTRL-Enter happy and sent before I was ready...) Building up strings in cfsavecontent also concatenates to the result variable so the problem is the same. = Hmm, I don't think you are correct Brian. I just whipped up a test of string

RE: CSV Generation MEMORY SUCK

2008-06-02 Thread Mark Kruger
Rick, What's your DB platform? Are you sure there is not a better non-cf way to do it? Mark A. Kruger, CFG, MCSE (402) 408-3733 ext 105 www.cfwebtools.com www.coldfusionmuse.com www.necfug.com -Original Message- From: Rick Root [mailto:[EMAIL PROTECTED] Sent: Monday, June 02, 2008

Re: CSV Generation MEMORY SUCK

2008-06-02 Thread Rick Root
SQL Server 2005. I'm open to suggestion. This is part of an application that allows users to generate CSV files of their own based on their own criteria, so though I'm open to non-CF solutions, I'm not sure there really would be anyway except maybe a homegrown java class to handle the work and

RE: CSV Generation MEMORY SUCK

2008-06-02 Thread Gaulin, Mark
and you'll have to look at running the query in java too, but I but you'll get something by handling the file better. Thanks Mark -Original Message- From: Rick Root [mailto:[EMAIL PROTECTED] Sent: Monday, June 02, 2008 10:33 AM To: CF-Talk Subject: Re: CSV Generation MEMORY SUCK SQL

Re: CSV Generation MEMORY SUCK

2008-06-02 Thread Phillip Duba
I know when I had to do this at a previous job I used ArrayAppend to build each line in the CSV, but I see you are using the string buffer. I had no performance diffs at the time, so I just stayed with the CF solution. The one thing I would look at is not using list functions, but instead using

Re: CSV Generation MEMORY SUCK

2008-06-02 Thread Rick Root
On Mon, Jun 2, 2008 at 10:50 AM, Gaulin, Mark [EMAIL PROTECTED] wrote: Also, test you page with the user's query but with the output part (actually writing the file) commented out... If the page is still slow and a huge memory hog then the file stuff above won't help much and you'll have to

Re: CSV Generation MEMORY SUCK

2008-06-02 Thread Gerald Guido
#Chr(34)##replace(arguments .str,chr(34),#chr(34)##chr(34)#,ALL)##Chr(34)# There is your bottle neck. CF does not like string manipulation on a large scale. I have tried to parsed large text files before only to watched my dev box just keel over. I see two options off the top of my head, let

Re: CSV Generation MEMORY SUCK

2008-06-02 Thread Brian Kotek
Use a Java StringBuffer or StringBuilder. Concatenating large strings in CF is always a memory hog because every single concatenation creates a new String instance. Check RIAForge, there are CFC libraries that wrap using these Java classes for exactly this purpose. You'll find memory usage drops

Re: CSV Generation MEMORY SUCK

2008-06-02 Thread Tom Chiverton
On Monday 02 Jun 2008, Rick Root wrote: generating the csv (around line 330-340 of the sample code I posted earlier) took 62 of the 68 seconds. Why not output the file all at once, rather than a line at a time (scrap lines ~336 - just keeping .append()'ing to a StringBuffer till your done) ?

Re: CSV Generation MEMORY SUCK

2008-06-02 Thread Rick Root
On Mon, Jun 2, 2008 at 11:40 AM, Gerald Guido [EMAIL PROTECTED] wrote: #Chr(34)##replace(arguments .str,chr(34),#chr(34)##chr(34)#,ALL)##Chr(34)# There is your bottle neck. CF does not like string manipulation on a large scale. I have tried to parsed large text files before only to

Re: CSV Generation MEMORY SUCK

2008-06-02 Thread Rick Root
On Mon, Jun 2, 2008 at 11:42 AM, Tom Chiverton [EMAIL PROTECTED] wrote: On Monday 02 Jun 2008, Rick Root wrote: generating the csv (around line 330-340 of the sample code I posted earlier) took 62 of the 68 seconds. Why not output the file all at once, rather than a line at a time (scrap

Re: CSV Generation MEMORY SUCK

2008-06-02 Thread Rick Root
Didn't look at the code, eh? On Mon, Jun 2, 2008 at 12:07 PM, Brian Kotek [EMAIL PROTECTED] wrote: Use a Java StringBuffer or StringBuilder. Concatenating large strings in CF On Mon, Jun 2, 2008 at 10:03 AM, Rick Root [EMAIL PROTECTED] wrote: http://cfm.pastebin.org/40043 -- Rick

Re: CSV Generation MEMORY SUCK

2008-06-02 Thread Rick Root
On Mon, Jun 2, 2008 at 12:34 PM, Brian Kotek [EMAIL PROTECTED] wrote: The difference is that you have to use the StringBuffer for everything. Since you aren't passing the StringBuffer into the CSVFormat method and I don't see the code for that method, I assume it is still suffering from the

Re: CSV Generation MEMORY SUCK

2008-06-02 Thread Brian Kotek
No, I opened it and saw that it was 400 lines long and didn't have time to go through it all. But sweeping through it quickly, the same advice applies. The difference is that you have to use the StringBuffer for everything. Since you aren't passing the StringBuffer into the CSVFormat method and I

Re: CSV Generation MEMORY SUCK

2008-06-02 Thread Rick Root
I found a nice little java class library called JavaCSV that handles all the file writing and dropped my time from 68 seconds to 18 seconds. That has potential! It basically handles the writing of delimiters and the proper csv formatting.. so here's my code: cfset var fileOutput =

Re: CSV Generation MEMORY SUCK

2008-06-02 Thread Gerald Guido
dropped my time from 68 seconds to 18 seconds Nice. Is that entirety of the code sans the query? little java class library called JavaCSV that handles The the one from SourceForge? I am going to need something like this shortly. G -- The important thing in science is not so much to

Re: CSV Generation MEMORY SUCK

2008-06-02 Thread Rick Root
On Mon, Jun 2, 2008 at 1:44 PM, Gerald Guido [EMAIL PROTECTED] wrote: dropped my time from 68 seconds to 18 seconds Nice. Is that entirety of the code sans the query? Entirety. The query itself takes about 4 seconds to execute and return all its data. little java class library called

RE: CSV Generation MEMORY SUCK

2008-06-02 Thread Mark Kruger
: Rick Root [mailto:[EMAIL PROTECTED] Sent: Monday, June 02, 2008 9:33 AM To: CF-Talk Subject: Re: CSV Generation MEMORY SUCK SQL Server 2005. I'm open to suggestion. This is part of an application that allows users to generate CSV files of their own based on their own criteria, so though I'm open

RE: CSV Generation MEMORY SUCK

2008-06-02 Thread Mark Kruger
-Talk Subject: Re: CSV Generation MEMORY SUCK On Mon, Jun 2, 2008 at 10:50 AM, Gaulin, Mark [EMAIL PROTECTED] wrote: Also, test you page with the user's query but with the output part (actually writing the file) commented out... If the page is still slow and a huge memory hog then the file