Why is chdir() so slow?

View: New views
3 Messages — Rating Filter:   Alert me  

Why is chdir() so slow?

by Raymond Irving :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello,

I've been doing some test with getcwd() and chdir() and it has  turned out that calling getcwd() is much faster than chdir()

Any ideas why this is so? Is it the OS?

Tested on Windows XP

Re: Why is chdir() so slow?

by Jonathan Tapicer :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

You know that getcwd and chdir do different things, right? Why are you
comparing them?

Jonathan

On Wed, Nov 4, 2009 at 10:31 PM, Raymond Irving <xwisdom@...> wrote:
> Hello,
>
> I've been doing some test with getcwd() and chdir() and it has  turned out that calling getcwd() is much faster than chdir()
>
> Any ideas why this is so? Is it the OS?
>
> Tested on Windows XP

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: Why is chdir() so slow?

by Raymond Irving :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

Yes, I know they do different things but I'm wondering if chdir makes a call to the OS or does it writes the value to a CWD variable inside the PHP engine?





________________________________
From: Jonathan Tapicer <tapicer@...>
To: Raymond Irving <xwisdom@...>
Cc: PHP-General List <php-general@...>
Sent: Wed, November 4, 2009 9:08:36 PM
Subject: Re: [PHP] Why is chdir() so slow?

You know that getcwd and chdir do different things, right? Why are you
comparing them?

Jonathan

On Wed, Nov 4, 2009 at 10:31 PM, Raymond Irving <xwisdom@...> wrote:
> Hello,
>
> I've been doing some test with getcwd() and chdir() and it has  turned out that calling getcwd() is much faster than chdir()
>
> Any ideas why this is so? Is it the OS?
>
> Tested on Windows XP

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php