Lots of calls to DirectoryExists()

0 views
Skip to first unread message

Joel Chia

unread,
Oct 20, 2008, 11:54:14 PM10/20/08
to cfau...@googlegroups.com

Hi,

I'm just working on a page here that's ment to display a link if a certain directory already exists on the server. DirectoryExists() does the job fine.

Does anyone know what kind of implications/impact there'll be if the page is called many many times (ie: intranet homepage kind of traffic levels)?

Mostly worried about it making the server cry.

Thanks!
-Joel

 

 

 

********************************* DISCLAIMER *********************************

The information contained in the above e-mail message or messages (which includes any attachments) is confidential and may be legally privileged. It is intended only for the use of the person or entity to which it is addressed. If you are not the addressee any form of disclosure, copying, modification, distribution or any action taken or omitted in reliance on the information is unauthorised. Opinions contained in the message(s) do not necessarily reflect the opinions of the Queensland Government and its authorities. If you received this communication in error, please notify the sender immediately and delete it from your computer system network.

 

 

 

Zac Spitzer

unread,
Oct 21, 2008, 4:15:30 AM10/21/08
to cfau...@googlegroups.com
Is there a performance issue ? don't prematurely optimise unless you have to:)

how does your app perform with your max expected number of users
and directories being checked?

file systems are pretty fast these days.

jmeter is pretty easy to setup to test this kinda load, there's a
quick guide on my blog if your intersted

--
Zac Spitzer -
http://zacster.blogspot.com (My Blog)
+61 405 847 168

Dale Fraser

unread,
Oct 21, 2008, 4:17:04 AM10/21/08
to cfau...@googlegroups.com

I think it wouldn’t be too bad, but there might be smarter ways.

 

What about recursively browse the directory once and build a struct, then you can use if structKey exists

 

Regards

Dale Fraser

Simon Haddon

unread,
Oct 21, 2008, 4:17:01 PM10/21/08
to cfau...@googlegroups.com
File system access to see if a file or directory exists is fast.  Can't imagine it causing a problem any more than, say, a small loop. Easier than a database query. If you start having performance issues then there could be a whole range of things that can cause problems rather than a directoryexists() call.

Cheers,
Simon

2008/10/21 Joel Chia <Joel...@childsafety.qld.gov.au>



--
Cheers
Simon Haddon

Woman loves feeling danger and speed. That is why woman wants man.  They get a speed rush that is the most dangerous of all.

Joel Chia

unread,
Oct 28, 2008, 8:26:10 PM10/28/08
to cfau...@googlegroups.com
I've gone off and used DirectoryExists() and it seems to be holding up fine. So I guess I was worrying for nothing :P
 
Cheers,
-Joel
 


From: cfau...@googlegroups.com [mailto:cfau...@googlegroups.com] On Behalf Of Simon Haddon
Sent: Wednesday, 22 October 2008 6:17 AM
To: cfau...@googlegroups.com
Subject: [cfaussie] Re: Lots of calls to DirectoryExists()

Barry Beattie

unread,
Oct 28, 2008, 8:32:39 PM10/28/08
to cfau...@googlegroups.com
I think it was Sean Corfield (could be wrong) that used to sprout a
particular wisdom along the lines of developing for maintainance and
reuse not performance

you can always refactor for performance later and if you built it with
maintainability in mind, refactoring should be pretty straightforward
and painless

CyberAngel

unread,
Oct 29, 2008, 12:19:28 AM10/29/08
to cfau...@googlegroups.com
I think it was Sean too, however it would not just be Sean.

One of things we as developers tend to ignore, well maybe not ignore. But we
do try to emphasise to much on getting it right the first time, the pressure
from clients to do this is let's say a big factor in the equation.

However it may never become a problem, and may scale very well. But as Barry
has indicated, one can always revisit and refactor if it ever does becomes a
problem.


Regards
Andrew Scott

Reply all
Reply to author
Forward
0 new messages