The problem with this solution is the high overhead of File Access.  If you
run 1 page, that's 1 file access, with possible a few more for
application.cfm, etc.  Probably a few more files if you're using a framework
like we are... so lets say 20 files on the average per request.  

Now lets say I'm looping and doing 1000 calls to a cfc in a single request
that produces the SQL query that I need.  If it's done through memory, it
takes around 1ms to make the call and return the sql.  If it's done through
a file read, I'm guessing it will be at least 20ms per call.  Multiply that
by 1000 and you can see that passing these things through a file is not
acceptable. 

Fortunatelly, I've already solved this by not having a function generate the
query (although it would've been nice).  I am just calling the same method
which does a query 1000 times (for 1000 records) and that seems to be the
fastest way.  I tried to combine it down to 1 query (basically a multi
statement query with 1000 statements).  First of all it would get very slow
with cfqueryparams, and even without them, it would still run slower then
calling the query separately 1000 times.  So I just optimized that single
query and so far so good. 

Russ

> -----Original Message-----
> From: Brad Wood [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, February 22, 2006 10:47 AM
> To: CF-Talk
> Subject: RE: cfsavecontent and cfqueryparam
> 
> Yes, but first of all, those are all reads.  Our example would be
> writing files, which requires exclusive access that part of the drive.
> Imagine your concentrated exclusive disk activity when multiple users
> are hitting that page at once.  Not to mention cold fusion files are
> compiled down to Java, and these would have to be recompiled every time.
> And you probably can't use your trusted cache setting in CF Admin with
> an approach like this too.  Also, your web server's reads and writes are
> closer to your operating system and they are buffered.  CFFILE has to go
> through an extra layer, and from what I understand it is not buffered
> and you have to wait for the entire file operation.  Now, the good side
> to that is the Java methods available now for file I/O are supposedly
> much better.
> 
> ~Brad
> 
> -----Original Message-----
> From: Snake [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, February 22, 2006 8:00 AM
> To: CF-Talk
> Subject: RE: cfsavecontent and cfqueryparam
> 
> FILE I/O happens with every page request.
> Every page has to be loaded from the disk, every cfinclude loads a file
> off
> a disk, every use of a custom tag, has to loa dthe tag file.
> Rather hard to avoid I/O
> 
> Russ
> 
> 
> 
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:233096
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to