Re: [PHP] Speed of sending email .. can I put them in a queue rather than wait?

2010-01-30 Thread Per Jessen
Angus Mann wrote:

> The number of emails sent is very small. Each one is only sent after a
> user fills out a form and presses send.
> 
> But there is a noticable lag of about 5 or sometimes 10 seconds after
> pressing "send" before the user sees the "Mail sent" page. I presume
> the reason for the lag is the time spent logging on and off a remote
> POP, then SMTP server, transferring the data etc.
> 
> It would be better if this happened in the background - that is, the
> user could get on with doing his next task while the emails sat in a
> queue in the backgorund, being lined up and sent without PHP waiting
> for the process to finish.

sendmail is your answer. 


/Per

-- 
Per Jessen, Zürich (0.6°C)


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



Re: [PHP] Speed of sending email .. can I put them in a queue rather than wait?

2010-01-30 Thread Manuel Lemos
Hello,

on 01/27/2010 12:07 AM Eric Lee said the following:
> Hi, all
> 
> I'am doubted about installing a local mail server for just low volume
> mailing.
> May I ask all yours professional what do you think about it ?

I do not use nor recommend Windows for delivering messages to many
recipients, but if you are stuck with it, maybe you can use Microsoft
Exchange in the same machine where PHP is running, you can drop the
messages in the mail queue pickup directory to avoid waiting for the
mail server to process them.

-- 

Regards,
Manuel Lemos

Find and post PHP jobs
http://www.phpclasses.org/jobs/

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

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



Re: [PHP] Speed of sending email .. can I put them in a queue rather than wait?

2010-01-26 Thread Paul M Foster
On Wed, Jan 27, 2010 at 10:07:13AM +0800, Eric Lee wrote:

> Hi, all
> 
> I'am doubted about installing a local mail server for just low volume
> mailing.
> May I ask all yours professional what do you think about it ?
> 

Every place I've ever hosted (all Linux servers) include a local MTA
which is up and running. In a large hosting operation, this local MTA
probably passes the mail for relay to a central MTA somewhere else in
the host's network. There are a variety of reasons for this. Among
others, it allows the hosting company to meter email and present a
single set of credentials to foreign (offsite) mail servers. And in
general, most hosting companies provide you with the location of the
local MTA, in case you need it for Perl, Python, cron or other scripts.
And PHP's mail() function will, by default, pass email to that local
MTA. And moreover, most (all?) Linux MTAs on boxes like this don't block
while they make connections. From the OP's description, it sounded like
his phpmailer() process was blocking while it made foreign connections.

Paul

-- 
Paul M. Foster

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



Re: [PHP] Speed of sending email .. can I put them in a queue rather than wait?

2010-01-26 Thread Eric Lee
Hi, all

I'am doubted about installing a local mail server for just low volume
mailing.
May I ask all yours professional what do you think about it ?


Thanks in advanced.



Regards,
Eric,




> --
> Jim Lucas
> NOC Manager
> 541-323-9113
> BendTel, Inc.
> http://www.bendtel.com
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


Re: [PHP] Speed of sending email .. can I put them in a queue rather than wait?

2010-01-26 Thread Jim Lucas
Manuel Lemos wrote:
> Hello,
> 
> On Tue, Jan 26, 2010 at 12:02 PM, Angus Mann  wrote:
>> I'm currently using the phpmailer class from phpmailer.worxware.com to
>> send datatbase -populated emails to clients.
>>
>> At the moment I'm runninng PHP on Windows and using the built-in sendmail
>> equivalent packaged with XAMPP. It uses a remote SMTP that authenticates by
>> prior logging into a POP account.
>>
>> The number of emails sent is very small. Each one is only sent after a user
>> fills out a form and presses send.
>>
>> But there is a noticable lag of about 5 or sometimes 10 seconds after
>> pressing "send" before the user sees the "Mail sent" page. I presume the
>> reason for the lag is the time spent logging on and off a remote POP, then
>> SMTP server, transferring the data etc.
>>
>> It would be better if this happened in the background - that is, the user
>> could get on with doing his next task while the emails sat in a queue in the
>> backgorund, being lined up and sent without PHP waiting for the process to
>> finish.
>>
>> Can anybody recommend a good way of doing this? Is Mercury Mail going to
>> help me here?
> 
> The problem is that you are using Windows. Windows is a weak platform
> for what you are doing as it lacks of free solutions like those you find
> in Linux or any other Unix like OS.
> 
> Under Linux practically every MTA has a queue. All MTAs queue messages
> by default instead of sending the message right away, except for sendmail.
> 
> That is way faster than having your application to send messages to your
> MTA by SMTP as you are doing.
> 

I agree that using a local MTA is somewhat faster then using a remote SMTP
server, but I would have to say that the performance issue that he is reporting
would be noticed by all that used remote SMTP servers if it were such a
significant difference.

I would argue that he needs to audit his code a little more.  What he said was
that the entire process from hitting the send button to showing the "Mail sent"
page took that long.  He said "I presume the reason for the lag is the time
spent logging on and off a remote POP, then SMTP server, transferring the data
etc."  I would suggest that he find out if it is or not.  I would like to see
proof that it is this portion of the script that is causing the slowness before
 suggest he change his server platform.

He mentioned pulling data from a DB and generating the email dynamically.  Maybe
it is the DB that is causing some lag because of a badly structured SQL call.
Maybe it has to do with the size of the data that he is requesting from the DB.

Could it be the amount of data that he is submitting through the form?

I would suggest that he try and replicate the process with the simplest of code.
 Even as far as removing the DB portion and sending hard coded data instead of
stuff pulled from the db.

Simply enough, I would have many things that I would suggest trying before
telling someone to replace their OS.

Just my 2cents...

> If you are really stuck with Windows, if you can use Microsoft Exchange,
> you may use a faster solution. Exchange has a local pickup queue
> directory. You just write messages in that directory and leave them
> there. PHP does not need to wait for any delivery. Exchange will pickup
> the messages ASAP and deliver them.
> 
> This is explained in this presentation. Jump to slide 11.
> 
> http://www.phpclasses.org/browse/video/3/package/9.html
> 
> If you want to use this solution, the MIME message package has a driver
> class for queueing messages in Exchange pickup queue directory . Take a
> look at the test_pickup_message.php example script.
> 
> 
> http://www.phpclasses.org/mimemessage
> 
> 


-- 
Jim Lucas
NOC Manager
541-323-9113
BendTel, Inc.
http://www.bendtel.com

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



Re: [PHP] Speed of sending email .. can I put them in a queue rather than wait?

2010-01-26 Thread Manuel Lemos
Hello,

On Tue, Jan 26, 2010 at 12:02 PM, Angus Mann  wrote:
> I'm currently using the phpmailer class from phpmailer.worxware.com to
> send datatbase -populated emails to clients.
>
> At the moment I'm runninng PHP on Windows and using the built-in sendmail
> equivalent packaged with XAMPP. It uses a remote SMTP that authenticates by
> prior logging into a POP account.
>
> The number of emails sent is very small. Each one is only sent after a user
> fills out a form and presses send.
>
> But there is a noticable lag of about 5 or sometimes 10 seconds after
> pressing "send" before the user sees the "Mail sent" page. I presume the
> reason for the lag is the time spent logging on and off a remote POP, then
> SMTP server, transferring the data etc.
>
> It would be better if this happened in the background - that is, the user
> could get on with doing his next task while the emails sat in a queue in the
> backgorund, being lined up and sent without PHP waiting for the process to
> finish.
>
> Can anybody recommend a good way of doing this? Is Mercury Mail going to
> help me here?

The problem is that you are using Windows. Windows is a weak platform
for what you are doing as it lacks of free solutions like those you find
in Linux or any other Unix like OS.

Under Linux practically every MTA has a queue. All MTAs queue messages
by default instead of sending the message right away, except for sendmail.

That is way faster than having your application to send messages to your
MTA by SMTP as you are doing.

If you are really stuck with Windows, if you can use Microsoft Exchange,
you may use a faster solution. Exchange has a local pickup queue
directory. You just write messages in that directory and leave them
there. PHP does not need to wait for any delivery. Exchange will pickup
the messages ASAP and deliver them.

This is explained in this presentation. Jump to slide 11.

http://www.phpclasses.org/browse/video/3/package/9.html

If you want to use this solution, the MIME message package has a driver
class for queueing messages in Exchange pickup queue directory . Take a
look at the test_pickup_message.php example script.


http://www.phpclasses.org/mimemessage


-- 

Regards,
Manuel Lemos

Find and post PHP jobs
http://www.phpclasses.org/jobs/

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

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



RE: [PHP] Speed of sending email .. can I put them in a queuerather than wait?

2010-01-26 Thread Bob McConnell
From: Paul M Foster
> On Tue, Jan 26, 2010 at 02:02:18PM +1000, Angus Mann wrote:
>>
>> I'm currently using the phpmailer class from phpmailer.worxware.com
>> to send datatbase -populated emails to clients.
>> 
>> At the moment I'm runninng PHP on Windows and using the built-in
>> sendmail equivalent packaged with XAMPP. It uses a remote SMTP that
>> authenticates by prior logging into a POP account.
>> 
>> The number of emails sent is very small. Each one is only sent after
>> a user fills out a form and presses send.
>> 
>> But there is a noticable lag of about 5 or sometimes 10 seconds
>> after pressing "send" before the user sees the "Mail sent" page.
>> I presume the reason for the lag is the time spent logging on and
>> off a remote POP, then SMTP server, transferring the data etc.
>> 
>> It would be better if this happened in the background - that is, the
>> user could get on with doing his next task while the emails sat in a
>> queue in the backgorund, being lined up and sent without PHP waiting
>> for the process to finish.
>> 
>> Can anybody recommend a good way of doing this? Is Mercury Mail going
>> to help me here?
>> 
> 
> If this were me, I'd set up a mailserver on the web machine and send
> mail to it instead of using phpmailer to connect directly to a distant
> mailserver. The authentication between phpmailer and the local
> mailserver should be near instantaneous, and you can let the local
> mailserver deal with transferring mails in its own sweet time. I don't
> know if there's a mailserver included in XAMPP installations, but if
so,
> I'd do that. In fact, if you're just sending simple emails, you could
> use PHP's built-in mail() function, which will connect directly to the
> local mailserver without further configuration.

As another option, I have a simple SMTP script (Perl) that listens on
port 25, accepts all forwarded messages and appends them to a text file.
Since it doesn't actually do anything, it is all but instantaneous. I
use it as a black hole relay MTA for development and test servers that
can't reach the real world. If anyone is interested, let me know and I
can send you a copy. It is adapted from something I found via Google.

Bob McConnell

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



Re: [PHP] Speed of sending email .. can I put them in a queue rather than wait?

2010-01-26 Thread Eric Lee
On Tue, Jan 26, 2010 at 12:02 PM, Angus Mann  wrote:

> Hi all.
>
> I'm currently using the phpmailer class from phpmailer.worxware.com to
> send datatbase -populated emails to clients.
>
> At the moment I'm runninng PHP on Windows and using the built-in sendmail
> equivalent packaged with XAMPP. It uses a remote SMTP that authenticates by
> prior logging into a POP account.
>
> The number of emails sent is very small. Each one is only sent after a user
> fills out a form and presses send.
>
> But there is a noticable lag of about 5 or sometimes 10 seconds after
> pressing "send" before the user sees the "Mail sent" page. I presume the
> reason for the lag is the time spent logging on and off a remote POP, then
> SMTP server, transferring the data etc.
>
> It would be better if this happened in the background - that is, the user
> could get on with doing his next task while the emails sat in a queue in the
> backgorund, being lined up and sent without PHP waiting for the process to
> finish.
>
> Can anybody recommend a good way of doing this? Is Mercury Mail going to
> help me here?
>
>
HI Angus,

+1 I agree on what Paul already said .
As in fact you were just to sent out low volume mails.
Create a table and queue all pending mails in that then use windows
scheduled tasks to perform the actual work
if that is not a real-time mail.


One thing to note, php on windows does't support specify username and
password.
But only hostname / IP Address and port only.


I can not help much
but just few more suggesions.

Hope these help

Eric,
Regards,


Re: [PHP] Speed of sending email .. can I put them in a queue rather than wait?

2010-01-25 Thread Paul M Foster
On Tue, Jan 26, 2010 at 02:02:18PM +1000, Angus Mann wrote:

> Hi all.
> 
> I'm currently using the phpmailer class from phpmailer.worxware.com to send 
> datatbase -populated emails to clients.
> 
> At the moment I'm runninng PHP on Windows and using the built-in sendmail 
> equivalent packaged with XAMPP. It uses a remote SMTP that authenticates by 
> prior logging into a POP account.
> 
> The number of emails sent is very small. Each one is only sent after a user 
> fills out a form and presses send.
> 
> But there is a noticable lag of about 5 or sometimes 10 seconds after 
> pressing "send" before the user sees the "Mail sent" page. I presume the 
> reason for the lag is the time spent logging on and off a remote POP, then 
> SMTP server, transferring the data etc.
> 
> It would be better if this happened in the background - that is, the user 
> could get on with doing his next task while the emails sat in a queue in the 
> backgorund, being lined up and sent without PHP waiting for the process to 
> finish.
> 
> Can anybody recommend a good way of doing this? Is Mercury Mail going to help 
> me here?
> 

If this were me, I'd set up a mailserver on the web machine and send
mail to it instead of using phpmailer to connect directly to a distant
mailserver. The authentication between phpmailer and the local
mailserver should be near instantaneous, and you can let the local
mailserver deal with transferring mails in its own sweet time. I don't
know if there's a mailserver included in XAMPP installations, but if so,
I'd do that. In fact, if you're just sending simple emails, you could
use PHP's built-in mail() function, which will connect directly to the
local mailserver without further configuration.

Paul

-- 
Paul M. Foster

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



Re: [PHP] Speed Issues PHP vs ASP.net

2009-08-25 Thread Bastien Koert
On Tue, Aug 25, 2009 at 10:37 AM, kyle.smith wrote:
>
> -Original Message-
> Recently i read this blog post about speed issues comparing PHP with
> ASP.net, please, read that and comment what you think about it:
> http://misfitgeek.com/blog/aspnet/php-versus-asp-net-ndash-windows-versu
> s-linux-ndash-who-rsquo-s-the-fastest/
>
> The big deal is: I don't know if this bechmark is true or false but,
> what are doing the PHP team about speed issues? Results like that maybe
> results like this can tarnish the image of language.
>
> So, what do you think about it?
>
>
> --
>
> My main issue with the tests is this:
>
> ASP.NET (C#) is psuedo-byte-code compiled and cached prior to execution.
> This is a huge boost to performance.  The tests should be re-done with
> something like IonCube compiled PHP.
>
> I think ASP.NET would still win, though.
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

The one big thing missed in the article is portability. While running
ASP.NET under Mono on Linux is possible, its not likely to be as
workable as taking php to almost any other environment.

And really,if you want to learn c# then just go learn java and make it better.

-- 

Bastien

Cat, the other other white meat

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



RE: [PHP] Speed Issues PHP vs ASP.net

2009-08-25 Thread kyle.smith
 
-Original Message-
Recently i read this blog post about speed issues comparing PHP with
ASP.net, please, read that and comment what you think about it:
http://misfitgeek.com/blog/aspnet/php-versus-asp-net-ndash-windows-versu
s-linux-ndash-who-rsquo-s-the-fastest/

The big deal is: I don't know if this bechmark is true or false but,
what are doing the PHP team about speed issues? Results like that maybe
results like this can tarnish the image of language.

So, what do you think about it?


--

My main issue with the tests is this:

ASP.NET (C#) is psuedo-byte-code compiled and cached prior to execution.
This is a huge boost to performance.  The tests should be re-done with
something like IonCube compiled PHP.

I think ASP.NET would still win, though.

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



Re: [PHP] Speed Opinion

2009-02-08 Thread Martin Zvarík

Nathan Rixham napsal(a):

Ashley Sheridan wrote:

On Thu, 2009-02-05 at 09:44 +1100, Chris wrote:

PHP wrote:

Hi all,
I am seeking some knowledge, hopefully I explain this right.

I am wondering what you think is faster.

Say you have 1000 records from 2 different tables that you need to 
get from a MySQL database.
A simple table will be displayed for each record, the second table 
contains related info for each record in table 1.


Is if faster to just read all the records from both tables into two 
arrays, then use php to go through the array for table 1 and figure 
out what records from table 2 are related.


Or, you dump all the data in table 1 into an array, then as you go 
through each record you make a database query to table 2.

Make the db do it.


PS:
I know I can use a join, but I find anytime I use a join, the 
database query is extremely slow, I have tried it for each version 
of mysql and php for the last few years. The delay difference is in 
the order of 100x slower or more.
Then you're missing indexes or something, I've joined tables with 
hundreds of thousands of records and it's very fast.


--
Postgresql & php tutorials
http://www.designmagick.com/



I've used joins on tables with millions of rows, and it's still not been
too slow to use. Admittedly it was an MSSQL database, which I've always
found to be slower, but MySQL was built to be a relational database, and
can handle many many millions of records quite happily. The slowdown you
experienced is either not using indexes on tables, or the way you were
displaying/manipulating those results from within PHP.


Ash
www.ashleysheridan.co.uk



and if you use spatial indexes and points instead of integers you can 
join on the biggest of databases with literally no perfomance hit, same 
speed regardless of table size :p (plus cos a point has two values you 
can use one for id and the other for timestamp ;)


regards

ps: i've said this many times before, but not for like 6 months so time 
for another reminder



"MySQL supports spatial extensions to allow the generation, storage, and 
analysis of geographic features."



So, I use spatial indexes when creating a geographic map? Is it good for 
anything else?


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



Re: [PHP] Speed Opinion

2009-02-04 Thread Nathan Rixham

Ashley Sheridan wrote:

On Thu, 2009-02-05 at 09:44 +1100, Chris wrote:

PHP wrote:

Hi all,
I am seeking some knowledge, hopefully I explain this right.

I am wondering what you think is faster.

Say you have 1000 records from 2 different tables that you need to get from a 
MySQL database.
A simple table will be displayed for each record, the second table contains 
related info for each record in table 1.

Is if faster to just read all the records from both tables into two arrays, 
then use php to go through the array for table 1 and figure out what records 
from table 2 are related.

Or, you dump all the data in table 1 into an array, then as you go through each 
record you make a database query to table 2.

Make the db do it.


PS:
I know I can use a join, but I find anytime I use a join, the database query is 
extremely slow, I have tried it for each version of mysql and php for the last 
few years. The delay difference is in the order of 100x slower or more.
Then you're missing indexes or something, I've joined tables with 
hundreds of thousands of records and it's very fast.


--
Postgresql & php tutorials
http://www.designmagick.com/



I've used joins on tables with millions of rows, and it's still not been
too slow to use. Admittedly it was an MSSQL database, which I've always
found to be slower, but MySQL was built to be a relational database, and
can handle many many millions of records quite happily. The slowdown you
experienced is either not using indexes on tables, or the way you were
displaying/manipulating those results from within PHP.


Ash
www.ashleysheridan.co.uk



and if you use spatial indexes and points instead of integers you can 
join on the biggest of databases with literally no perfomance hit, same 
speed regardless of table size :p (plus cos a point has two values you 
can use one for id and the other for timestamp ;)


regards

ps: i've said this many times before, but not for like 6 months so time 
for another reminder


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



Re: [PHP] Speed Opinion

2009-02-04 Thread Ashley Sheridan
On Thu, 2009-02-05 at 09:44 +1100, Chris wrote:
> PHP wrote:
> > Hi all,
> > I am seeking some knowledge, hopefully I explain this right.
> > 
> > I am wondering what you think is faster.
> > 
> > Say you have 1000 records from 2 different tables that you need to get from 
> > a MySQL database.
> > A simple table will be displayed for each record, the second table contains 
> > related info for each record in table 1.
> > 
> > Is if faster to just read all the records from both tables into two arrays, 
> > then use php to go through the array for table 1 and figure out what 
> > records from table 2 are related.
> > 
> > Or, you dump all the data in table 1 into an array, then as you go through 
> > each record you make a database query to table 2.
> 
> Make the db do it.
> 
> > PS:
> > I know I can use a join, but I find anytime I use a join, the database 
> > query is extremely slow, I have tried it for each version of mysql and php 
> > for the last few years. The delay difference is in the order of 100x slower 
> > or more.
> 
> Then you're missing indexes or something, I've joined tables with 
> hundreds of thousands of records and it's very fast.
> 
> -- 
> Postgresql & php tutorials
> http://www.designmagick.com/
> 
> 
I've used joins on tables with millions of rows, and it's still not been
too slow to use. Admittedly it was an MSSQL database, which I've always
found to be slower, but MySQL was built to be a relational database, and
can handle many many millions of records quite happily. The slowdown you
experienced is either not using indexes on tables, or the way you were
displaying/manipulating those results from within PHP.


Ash
www.ashleysheridan.co.uk


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



Re: [PHP] Speed Opinion

2009-02-04 Thread Robert Cummings
On Wed, 2009-02-04 at 14:42 -0800, PHP wrote:
> Hi all,
> I am seeking some knowledge, hopefully I explain this right.
> 
> I am wondering what you think is faster.
> 
> Say you have 1000 records from 2 different tables that you need to get from a 
> MySQL database.
> A simple table will be displayed for each record, the second table contains 
> related info for each record in table 1.
> 
> Is if faster to just read all the records from both tables into two arrays, 
> then use php to go through the array for table 1 and figure out what records 
> from table 2 are related.
> 
> Or, you dump all the data in table 1 into an array, then as you go through 
> each record you make a database query to table 2.
> 
> 
> 
> 
> PS:
> I know I can use a join, but I find anytime I use a join, the database query 
> is extremely slow, I have tried it for each version of mysql and php for the 
> last few years. The delay difference is in the order of 100x slower or more.

Grab records from table 1... build a list of IDs to match in table 2.
Use an IN clause. 2 queries and no joins as you requested.

SELECT * from foo_table AS FOO where "something something";

SELECT * from fee_table AS FEE where foo_id IN ( list, of, ids );

You REALLY don't want to do a query for every row matched in the first
query.

Cheers,
Rob.
-- 
http://www.interjinn.com
Application and Templating Framework for PHP


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



Re: [PHP] Speed Opinion

2009-02-04 Thread Afan Pasalic


PHP wrote:

Hi all,
I am seeking some knowledge, hopefully I explain this right.

I am wondering what you think is faster.

Say you have 1000 records from 2 different tables that you need to get from a 
MySQL database.
A simple table will be displayed for each record, the second table contains 
related info for each record in table 1.

Is if faster to just read all the records from both tables into two arrays, 
then use php to go through the array for table 1 and figure out what records 
from table 2 are related.

Or, you dump all the data in table 1 into an array, then as you go through each 
record you make a database query to table 2.
  


in general mysql is "faster" than php. do/select as much as you can in 
mysql.



-afan



PS:
I know I can use a join, but I find anytime I use a join, the database query is 
extremely slow, I have tried it for each version of mysql and php for the last 
few years. The delay difference is in the order of 100x slower or more.


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



Re: [PHP] Speed Opinion

2009-02-04 Thread Chris

PHP wrote:

Hi all,
I am seeking some knowledge, hopefully I explain this right.

I am wondering what you think is faster.

Say you have 1000 records from 2 different tables that you need to get from a 
MySQL database.
A simple table will be displayed for each record, the second table contains 
related info for each record in table 1.

Is if faster to just read all the records from both tables into two arrays, 
then use php to go through the array for table 1 and figure out what records 
from table 2 are related.

Or, you dump all the data in table 1 into an array, then as you go through each 
record you make a database query to table 2.


Make the db do it.


PS:
I know I can use a join, but I find anytime I use a join, the database query is 
extremely slow, I have tried it for each version of mysql and php for the last 
few years. The delay difference is in the order of 100x slower or more.


Then you're missing indexes or something, I've joined tables with 
hundreds of thousands of records and it's very fast.


--
Postgresql & php tutorials
http://www.designmagick.com/


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



Re: [PHP] Speed of apache/php4 on windows

2007-03-31 Thread Richard Lynch
On Sat, March 31, 2007 3:49 pm, Don Don wrote:
> Hi all, i've got apache/php4 running on windows xp with good hardware
> configuration etc. However, the speed of execution of php pages is
> really slow.   When testing on my local development machine it takes a
> few more seconds executing php files than it should normally take.
>
>   How can I up the speed of execution ?  is this possible ?  On my
> hosting server its really really fast !  and I will like the same
> settings for my local machine as it has a very good hardware
> configuration and memory.

Just for fun, throw an Ubuntu disk in the box, and time your PHP
scripts without Windows being in the way -- That will give you a
baseline for YOUR hardware, independent of the webhosting hardware.

Did you install Apache with PHP as a CGI (rather than Module)?
If so, php.exe has to start up, in its own process/thread/whatever,
for each page hit.
This can add significant time, I believe.
You can check using  in a script and seeing if your
SAPI is "CGI" or "Module"

There are also a zillion things in Windows that could be running, many
of which are real dogs.
What does your process list show? (control-alt-del will get you to it)

Presumably there are general process profiling tools on Windows, akin
to valgrind/callgrind on Linux.
Find one, and see if it can shed any light on the matter.

-- 
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?

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



Re: [PHP] Speed

2006-01-11 Thread Rodolfo Andrade
I think calculating directly in MySQL will be faster, since less data will
be "travelling" from MySQL to PHP.

Just my 2¢.

Regards,
Rodolfo Andrade

- Original Message - 
From: Weber Sites LTD
To: 'Peter Lauri' ; php-general@lists.php.net
Sent: Wednesday, January 11, 2006 6:07 AM
Subject: RE: [PHP] Speed


Why not check it?

Try to query for the AVG() and get the result or query for the data
and do a loop in PHP to calculate the AVG. Check the time each
Takes.

My Money is that getting the value from SQL will be faster.

Sincerely

berber

Visit the Weber Sites Today,
To see where PHP might take you tomorrow.
PHP code examples : http://www.weberdev.com
PHP Web Logs : http://www.weberblog.com/
PHP & MySQL Forums : http://www.weberforums.com/
Learn PHP Playing Trivia http://www.webertrivia.com
Web Development Index http://www.weberindex.com
Web Templates http://www.webertemplates.com
Search for PHP Code from your browser http://toolbar.weberdev.com


-Original Message-
From: Peter Lauri [mailto:[EMAIL PROTECTED]
Sent: Wednesday, January 11, 2006 9:14 AM
To: php-general@lists.php.net
Subject: [PHP] Speed

Best group member,



Assume that I save data about an object and it has 10.000 observations of
the object stored in a MySQL database. I want calculate the average value of
a column, is it faster done by using PHP on the result array or using the
MySQL function to do that?



/Peter

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

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



RE: [PHP] Speed

2006-01-11 Thread Weber Sites LTD
Why not check it?

Try to query for the AVG() and get the result or query for the data
and do a loop in PHP to calculate the AVG. Check the time each 
Takes.

My Money is that getting the value from SQL will be faster.

Sincerely 
 
berber 
 
Visit the Weber Sites Today, 
To see where PHP might take you tomorrow. 
PHP code examples : http://www.weberdev.com 
PHP Web Logs : http://www.weberblog.com/ 
PHP & MySQL Forums : http://www.weberforums.com/ 
Learn PHP Playing Trivia http://www.webertrivia.com 
Web Development Index http://www.weberindex.com 
Web Templates http://www.webertemplates.com
Search for PHP Code from your browser http://toolbar.weberdev.com 


-Original Message-
From: Peter Lauri [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, January 11, 2006 9:14 AM
To: php-general@lists.php.net
Subject: [PHP] Speed

Best group member,

 

Assume that I save data about an object and it has 10.000 observations of
the object stored in a MySQL database. I want calculate the average value of
a column, is it faster done by using PHP on the result array or using the
MySQL function to do that?

 

/Peter

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



Re: [PHP] Speed

2006-01-11 Thread Philip Hallstrom

Assume that I save data about an object and it has 10.000 observations of
the object stored in a MySQL database. I want calculate the average value of
a column, is it faster done by using PHP on the result array or using the
MySQL function to do that?


MySQL.

You don't have to transfer all 10,000 records to PHP for one thing.

-philip

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



RE: [PHP] Speed/Efficiency Question: Large array into DB

2005-10-11 Thread Alan Lord
Thanks for the reply.

I am indeed importing data, but from far away over the 'net, and it
changes frequently so needs  updating regularly.

I like the idea of creating a file (I'll do it ram rather than a text
file I think) with the insert strings...

Thanks

Alan

> -Original Message-
> From: Brent Baisley [mailto:[EMAIL PROTECTED] 
> Sent: 11 October 2005 19:35
> To: Alan Lord
> Cc: php-general@lists.php.net
> Subject: Re: [PHP] Speed/Efficiency Question: Large array into DB
> 
> Sounds to me like you are trying to import data. In which 
> case it would be best to create a text file and import it 
> rather than putting PHP in the middle.
> 
> But if you are going us to PHP, I would not do individual INSERTs.  
> The overhead will really slow things down with number of 
> inserts you are doing. Use the multiple value insert syntax 
> and do multiple bulk inserts or just one big one. Although 
> doing one big one will end up being an all or nothing deal. 
> With multiple bulk inserts, you'd be able to write to a log 
> file between inserts so you can track it's progress.
> 
> I would step through the array, creating the string for 
> inserting (value1, value2, value3, value4),(value1, value2, 
> value3, value4), (value1, value2, value3, value4),...
> 
> 
> On Oct 11, 2005, at 12:28 PM, Alan Lord wrote:
> 
> > Hi All,
> >
> > Not being a professional programmer I am looking for some 
> advice about 
> > the best way to do the following:
> >
> > I have a large multidimensional array (up to 7Mb) It 
> contains a list 
> > of categories in a fairly normal Cat_ID and Parent_ID 
> arrangement. The 
> > array also contains a great deal of superfluous information which I 
> > want to ignore.
> >
> > I wish to walk through the entire array, select 4 key/value 
> pairs from 
> > each sub-array and write those to my Database (Keys are: Cat_ID, 
> > Parent_ID, CatName, CatLevel). I wish to ignore all other 
> key/ values 
> > in each array.
> >
> > I'm guessing that I should use array_walk_recursive() and apply my 
> > test for valid keys then write this into my db... But, should I do 
> > this for each iteration, or make a new array with just the 
> information 
> > I need then write that into my DB? And do I use a 
> transaction/commit 
> > block and try to do the whole thing in one db-write or 
> again, INSERT 
> > on each step through my array?
> >
> > Oh yes, the key names in the array correspond to field names in my 
> > database.
> >
> > Sorry it's a bit long-winded...
> >
> > Thanks in advance for any suggestions.
> >
> > Alan
> >
> > --
> > PHP General Mailing List (http://www.php.net/) To 
> unsubscribe, visit: 
> > http://www.php.net/unsub.php
> >
> >
> >
> 
> --
> Brent Baisley
> Systems Architect
> Landover Associates, Inc.
> Search & Advisory Services for Advanced Technology Environments
> p: 212.759.6400/800.759.0577
> 
> 
> 

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



Re: [PHP] Speed/Efficiency Question: Large array into DB

2005-10-11 Thread Brent Baisley
Sounds to me like you are trying to import data. In which case it  
would be best to create a text file and import it rather than putting  
PHP in the middle.


But if you are going us to PHP, I would not do individual INSERTs.  
The overhead will really slow things down with number of inserts you  
are doing. Use the multiple value insert syntax and do multiple bulk  
inserts or just one big one. Although doing one big one will end up  
being an all or nothing deal. With multiple bulk inserts, you'd be  
able to write to a log file between inserts so you can track it's  
progress.


I would step through the array, creating the string for inserting  
(value1, value2, value3, value4),(value1, value2, value3, value4), 
(value1, value2, value3, value4),...



On Oct 11, 2005, at 12:28 PM, Alan Lord wrote:


Hi All,

Not being a professional programmer I am looking for some advice about
the best way to do the following:

I have a large multidimensional array (up to 7Mb) It contains a  
list of

categories in a fairly normal Cat_ID and Parent_ID arrangement. The
array also contains a great deal of superfluous information which I  
want

to ignore.

I wish to walk through the entire array, select 4 key/value pairs from
each sub-array and write those to my Database (Keys are: Cat_ID,
Parent_ID, CatName, CatLevel). I wish to ignore all other key/ 
values in

each array.

I'm guessing that I should use array_walk_recursive() and apply my  
test

for valid keys then write this into my db... But, should I do this for
each iteration, or make a new array with just the information I need
then write that into my DB? And do I use a transaction/commit block  
and
try to do the whole thing in one db-write or again, INSERT on each  
step

through my array?

Oh yes, the key names in the array correspond to field names in my
database.

Sorry it's a bit long-winded...

Thanks in advance for any suggestions.

Alan

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





--
Brent Baisley
Systems Architect
Landover Associates, Inc.
Search & Advisory Services for Advanced Technology Environments
p: 212.759.6400/800.759.0577

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



Re: [PHP] speed - PHP/MYSQL

2005-07-24 Thread balwant singh
Actually the data inserted in MYSQL is at every 2 seconds. i.e. 30 rows 
in an hour.  but we are making report on hourly basis.  So i used this 
method. 


With best wishes
balwant

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



Re: [PHP] speed - PHP/MYSQL

2005-07-23 Thread Joe Wollard
I agree with Jasper here, you want to make it a point to optimize  
your queries so that fewer trips are made to the database server. On  
the topic of indexing, I'm curious as to how you did that and if your  
using it as intended. In your query you are testing columns  
`time`,`date` so you'll want to make sure that those are two columns  
that have been indexed.


You might want to investigate different types of indexes and how to  
optimize them too. In my own experience I know that FULLTEXT indexes  
work wonders for large 'search engine' tables.


Multiple Column index
 - http://dev.mysql.com/doc/mysql/en/multiple-column-indexes.html

FULLTEXT index
 - http://dev.mysql.com/doc/mysql/en/fulltext-search.html


Another thing to look at is optimizing your column types. If for  
instance you have single characters stored in a column that is  
defined as type BLOB instead of CHAR, your going to slow your queries  
a bit.

 - http://dev.mysql.com/doc/mysql/en/data-size.html


Good luck!
-Joe

On Jul 23, 2005, at 6:18 AM, Jasper Bryant-Greene wrote:


balwant singh wrote:


Hi,
I have made a  webpage in php which retrieves the data from a huge  
MYSQL tables as below:-

$i=0;
while ($i<=23)
{
select a, b from table where hour(time)=$i and date='' order by  
desc time limit 1;

$i++;
}
then i substract the current hour output from the last hour output  
for calcuating the output in that hour through PHP code and then  
display it.
But my problem is that this page  takes approx. 90 seconds or more  
for loading even when i refresh the page, it is taking the same time.
I have done indexing on that table, tune the php and apache but it  
is still taking same time.
I have other tables also when PHP is doing more calculatios but  
those pages are not taking so much time they load in 5 sec. or so.

Is there anything needs to be done more, please advise.



Don't loop through in PHP and execute the query 23 times. Instead,  
execute the query once (without the "hour(time)=$1 and " and the  
"limit 1", and use a while($row = mysql_fetch_assoc($result)) { }  
type function to get all 23 rows. That will be much faster.


By the way, that should probably be "order by time desc" not "order  
by desc time".


Jasper

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




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



Re: [PHP] speed - PHP/MYSQL

2005-07-23 Thread Jasper Bryant-Greene

balwant singh wrote:

Hi,

I have made a  webpage in php which retrieves the data from a huge MYSQL 
tables as below:-


$i=0;
while ($i<=23)
{
select a, b from table where hour(time)=$i and date='' order by desc 
time limit 1;

$i++;
}

then i substract the current hour output from the last hour output for 
calcuating the output in that hour through PHP code and then display it.


But my problem is that this page  takes approx. 90 seconds or more for 
loading even when i refresh the page, it is taking the same time.


I have done indexing on that table, tune the php and apache but it is 
still taking same time.


I have other tables also when PHP is doing more calculatios but those 
pages are not taking so much time they load in 5 sec. or so.


Is there anything needs to be done more, please advise.


Don't loop through in PHP and execute the query 23 times. Instead, 
execute the query once (without the "hour(time)=$1 and " and the "limit 
1", and use a while($row = mysql_fetch_assoc($result)) { } type function 
to get all 23 rows. That will be much faster.


By the way, that should probably be "order by time desc" not "order by 
desc time".


Jasper

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



Re: [PHP] speed of mail() on two servers

2003-08-29 Thread David T-G
Raditha, et al --

...and then Raditha Dissanayake said...
% 
% Hello David,

Hi!


% looks like a bit of a tough one :-) guess you might be better off trying 

Indeed.


% one of the qmail groups instead of this one. Sorry my own qmail 

Oh, whoops!  Yes, I'm already being a general pest on the qmail list and
have been able to do some digging, though I don't yet have answers.


% expertise isn't as good as it should be.

Nor is mine :-/


% 
% best regards
% raditha


Thanks & HAND

:-D
-- 
David T-G  * There is too much animal courage in 
(play) [EMAIL PROTECTED] * society and not sufficient moral courage.
(work) [EMAIL PROTECTED]  -- Mary Baker Eddy, "Science and Health"
http://justpickone.org/davidtg/  Shpx gur Pbzzhavpngvbaf Qrprapl Npg!



pgp0.pgp
Description: PGP signature


Re: [PHP] speed of mail() on two servers

2003-08-29 Thread Raditha Dissanayake
Hello David,
looks like a bit of a tough one :-) guess you might be better off trying 
one of the qmail groups instead of this one. Sorry my own qmail 
expertise isn't as good as it should be.

best regards
raditha
David T-G wrote:

jabber, et al --

...and then [EMAIL PROTECTED] said...
% 
% Hello,

Hi!

% 
% I recall someone (pardone me i don't save list mails) pointing out that 
% the delay could actually be in generating the message rather than in the 

Yep.  Nope.

% sending. You are sending a customized message to each user aren't you? 

Yep.

% Would you be creating this message from what's in a mysql database or 
% something like that?

My message generation runs through about 800 messages in a bit under
three seconds.  While that may or may not be fantastic or efficient,
it's a couple of orders of magnitude faster than the mail injection :-)
% 
% Have you tried running your php script from the command line instead of 

Actually, this has always been a CLI script.  Those interested can see it
at
 http://killswitcharmy.com/Q/massmail-send-script.php.txt

as long as you promise not to laugh at all of the debugging and other
crap that's in there at the moment :-)
I've managed to pin it down to the qmail injection process, though I
haven't gotten farther enough to know whether it's a qmail config issue
or an overall OS issue.  It isn't php's fault :-)  Using mail() takes
an extra 70ms over just a system call to qmail-inject directly, so I'll
stick with the latter, but a drop from ~0.54 sec to ~0.47 sec isn't
nearly as far as I need to go (I need total time to be about 100ms at
the most and would love to see 60 *total* so that I can get out some 60k
messages in an hour).
% the web space? It could be that your httpd.conf has some processor and 
% memory usage restrictions imposed. I once worked on a server on which it 
% was impossible to send mail from cgi script. the apache configurations 
% turned out to be the culprit.

Heh :-)

% 
% all the best

Thanks & HAND

:-D
 



--
http://www.raditha.com/php/progress.php
A progress bar for PHP file uploads.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] speed of mail() on two servers

2003-08-29 Thread David T-G
jabber, et al --

...and then [EMAIL PROTECTED] said...
% 
% Hello,

Hi!


% 
% I recall someone (pardone me i don't save list mails) pointing out that 
% the delay could actually be in generating the message rather than in the 

Yep.  Nope.


% sending. You are sending a customized message to each user aren't you? 

Yep.


% Would you be creating this message from what's in a mysql database or 
% something like that?

My message generation runs through about 800 messages in a bit under
three seconds.  While that may or may not be fantastic or efficient,
it's a couple of orders of magnitude faster than the mail injection :-)


% 
% Have you tried running your php script from the command line instead of 

Actually, this has always been a CLI script.  Those interested can see it
at

  http://killswitcharmy.com/Q/massmail-send-script.php.txt

as long as you promise not to laugh at all of the debugging and other
crap that's in there at the moment :-)

I've managed to pin it down to the qmail injection process, though I
haven't gotten farther enough to know whether it's a qmail config issue
or an overall OS issue.  It isn't php's fault :-)  Using mail() takes
an extra 70ms over just a system call to qmail-inject directly, so I'll
stick with the latter, but a drop from ~0.54 sec to ~0.47 sec isn't
nearly as far as I need to go (I need total time to be about 100ms at
the most and would love to see 60 *total* so that I can get out some 60k
messages in an hour).


% the web space? It could be that your httpd.conf has some processor and 
% memory usage restrictions imposed. I once worked on a server on which it 
% was impossible to send mail from cgi script. the apache configurations 
% turned out to be the culprit.

Heh :-)


% 
% all the best


Thanks & HAND

:-D
-- 
David T-G  * There is too much animal courage in 
(play) [EMAIL PROTECTED] * society and not sufficient moral courage.
(work) [EMAIL PROTECTED]  -- Mary Baker Eddy, "Science and Health"
http://justpickone.org/davidtg/  Shpx gur Pbzzhavpngvbaf Qrprapl Npg!



pgp0.pgp
Description: PGP signature


Re: [PHP] speed of mail() on two servers

2003-08-28 Thread [EMAIL PROTECTED]
Hello,

I recall someone (pardone me i don't save list mails) pointing out that 
the delay could actually be in generating the message rather than in the 
sending. You are sending a customized message to each user aren't you? 
Would you be creating this message from what's in a mysql database or 
something like that?

Have you tried running your php script from the command line instead of 
the web space? It could be that your httpd.conf has some processor and 
memory usage restrictions imposed. I once worked on a server on which it 
was impossible to send mail from cgi script. the apache configurations 
turned out to be the culprit.

all the best



David T-G wrote:

Jabber, et al --

...and then [EMAIL PROTECTED] said...
% 
% having you tried ezmlm or to directly inject the message into the que?

Yes, I've tried qmail-inject.  I got down to about 0.41s/msg which is
still terrible.
Thanks & HAND

:-D
 



--
http://www.raditha.com/php/progress.php
A progress bar for PHP file uploads.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] speed of mail() on two servers

2003-08-28 Thread David T-G
Jabber, et al --

...and then [EMAIL PROTECTED] said...
% 
% having you tried ezmlm or to directly inject the message into the que?

Yes, I've tried qmail-inject.  I got down to about 0.41s/msg which is
still terrible.


Thanks & HAND

:-D
-- 
David T-G  * There is too much animal courage in 
(play) [EMAIL PROTECTED] * society and not sufficient moral courage.
(work) [EMAIL PROTECTED]  -- Mary Baker Eddy, "Science and Health"
http://justpickone.org/davidtg/  Shpx gur Pbzzhavpngvbaf Qrprapl Npg!



pgp0.pgp
Description: PGP signature


Re: [PHP] speed of mail() on two servers

2003-08-27 Thread [EMAIL PROTECTED]
having you tried ezmlm or to directly inject the message into the que?

Javier Tacon wrote:

I think that may be 'problem' from sendmail .. mail() function under
linux only interacts with sendmail, it doesn't contact to the remote
SMTP to leave the mail. Do you have the same sendmail version in two
machines? You should compare both sendmail configuration and try to
check the speed from a bash script for example.
-Mensaje original-
De: David T-G [mailto:[EMAIL PROTECTED]
Enviado el: miercoles, 27 de agosto de 2003 0:40
Para: PHP General list
Asunto: [PHP] speed of mail() on two servers
Hi, all --

I'm working up a [cli] script to send a personalized (ugh) email to some
[often large] number of web site subscribers.  Unfortunately, I'm
getting
lousy performance, running about 0.54 sec per email.
My partner has a mail script implemented on another machine and he's
running somewhere down around 0.10 sec per email, which is better but
still not very good for sending to 60k users.
The box (dual Xeon 2.2G with mirrored fast SCSI and 1G RAM) has plenty
of
horsepower, and it certainly shouldn't need more.  It's running RH 7.3
(Valhalla) with 2.4.20 on ext3 and has qmail installed as its MTA.
It seems to be the mail() call itself, because I can make a system call
(system, exec, passthru) to just echo the current data and it rips
through my list in nothin' flat.  So how do I tune mail() to make it
faster?  Or do I need to give up and call qmail-inject directly?
TIA & HAND

:-D
 



--
http://www.raditha.com/php/progress.php
A progress bar for PHP file uploads.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] speed of mail() on two servers

2003-08-27 Thread Curt Zirzow
* Thus wrote David T-G ([EMAIL PROTECTED]):
> 
> It seems to be the mail() call itself, because I can make a system call
> (system, exec, passthru) to just echo the current data and it rips
> through my list in nothin' flat.  So how do I tune mail() to make it
> faster?  Or do I need to give up and call qmail-inject directly?

The mail() command simply passes the message to the sendmail
configured in you php.ini.  You might want to check the
configuration of sendmail, it might be the bottleneck.


Curt
-- 
"I used to think I was indecisive, but now I'm not so sure."

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



[PHP] Re: php.ini sendmail settings (was "Re: [PHP] speed of mail() ... ")

2003-08-27 Thread David T-G
Hi again, everyone --

I have a feeling that our problem is a lousy php.ini configuration.  For
both module and CLI php we're using /usr/local/lib/php.ini, so I look in
there and I see

  [mail function]
  ; For Win32 only.
  SMTP = localhost

  ; For Win32 only.
  sendmail_from = [EMAIL PROTECTED]

  ; For Unix only.  You may supply arguments as well (default: "sendmail -t -i").
  ;sendmail_path =

and get a little worried.  But in the phpinfo() output I have

  ...
  sendmail_from  [EMAIL PROTECTED] [EMAIL PROTECTED]
  sendmail_path  /usr/sbin/sendmail -t -i /usr/sbin/sendmail -t -i
  ...

(for both web and CLI) which, aside from the silly sendmail_from value,
looks right after all.

Do our admins have us set up to make an SMTP connection -- back to
ourselves, even -- for every mail?  If not, how on earth do we have a
value for sendmail_path (which, in fact, points to an existing link to
qmail's sendmail, just as it should).

If I DO need to fix it, what are the *correct* values for sendmail_from
and SMTP on this *NIX box; should I just comment them out?  And then I
imagine that apache needs a restart to see the new php.ini values, no?


Even more confused,
:-D
-- 
David T-G  * There is too much animal courage in 
(play) [EMAIL PROTECTED] * society and not sufficient moral courage.
(work) [EMAIL PROTECTED]  -- Mary Baker Eddy, "Science and Health"
http://justpickone.org/davidtg/  Shpx gur Pbzzhavpngvbaf Qrprapl Npg!



pgp0.pgp
Description: PGP signature


Re: [PHP] speed of mail() on two servers

2003-08-27 Thread David T-G
Javier --

...and then Javier Tacon said...
% 
% May be the machine of your friend has a better network output than your
% machine :)

Heh :-)  Hey, stranger things have happenned!

But check my other followup for an interesting twist.


Thanks again &  HAND

:-D
-- 
David T-G  * There is too much animal courage in 
(play) [EMAIL PROTECTED] * society and not sufficient moral courage.
(work) [EMAIL PROTECTED]  -- Mary Baker Eddy, "Science and Health"
http://justpickone.org/davidtg/  Shpx gur Pbzzhavpngvbaf Qrprapl Npg!



pgp0.pgp
Description: PGP signature


RE: [PHP] speed of mail() on two servers

2003-08-27 Thread Javier Tacon

May be the machine of your friend has a better network output than your
machine :)


-Mensaje original-
De: David T-G [mailto:[EMAIL PROTECTED]
Enviado el: miercoles, 27 de agosto de 2003 11:59
Para: PHP General list
CC: Javier Tacon
Asunto: Re: [PHP] speed of mail() on two servers


Javier, et al --

...and then Javier Tacon said...
% 
% I think that may be 'problem' from sendmail .. mail() function under
% linux only interacts with sendmail, it doesn't contact to the remote

Right.  Only it doesn't make much sense, because qmail is FAST.


% SMTP to leave the mail. Do you have the same sendmail version in two
% machines? You should compare both sendmail configuration and try to
% check the speed from a bash script for example.

Unfortunately, I can't get to his other server, and he doesn't really
know anything about its guts (he's a great php coder and a great art
designer, but he's entirely a windoze guy).  I don't even know if he's
running qmail there.


Thanks & HAND

:-D
-- 
David T-G  * There is too much animal courage in 
(play) [EMAIL PROTECTED] * society and not sufficient moral
courage.
(work) [EMAIL PROTECTED]  -- Mary Baker Eddy, "Science and
Health"
http://justpickone.org/davidtg/  Shpx gur Pbzzhavpngvbaf Qrprapl
Npg!

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



Re: [PHP] speed of mail() on two servers

2003-08-27 Thread David T-G
Javier, et al --

...and then Javier Tacon said...
% 
% I think that may be 'problem' from sendmail .. mail() function under
% linux only interacts with sendmail, it doesn't contact to the remote

Right.  Only it doesn't make much sense, because qmail is FAST.


% SMTP to leave the mail. Do you have the same sendmail version in two
% machines? You should compare both sendmail configuration and try to
% check the speed from a bash script for example.

Unfortunately, I can't get to his other server, and he doesn't really
know anything about its guts (he's a great php coder and a great art
designer, but he's entirely a windoze guy).  I don't even know if he's
running qmail there.


Thanks & HAND

:-D
-- 
David T-G  * There is too much animal courage in 
(play) [EMAIL PROTECTED] * society and not sufficient moral courage.
(work) [EMAIL PROTECTED]  -- Mary Baker Eddy, "Science and Health"
http://justpickone.org/davidtg/  Shpx gur Pbzzhavpngvbaf Qrprapl Npg!



pgp0.pgp
Description: PGP signature


RE: [PHP] speed of mail() on two servers

2003-08-27 Thread Javier Tacon

I think that may be 'problem' from sendmail .. mail() function under
linux only interacts with sendmail, it doesn't contact to the remote
SMTP to leave the mail. Do you have the same sendmail version in two
machines? You should compare both sendmail configuration and try to
check the speed from a bash script for example.


-Mensaje original-
De: David T-G [mailto:[EMAIL PROTECTED]
Enviado el: miercoles, 27 de agosto de 2003 0:40
Para: PHP General list
Asunto: [PHP] speed of mail() on two servers


Hi, all --

I'm working up a [cli] script to send a personalized (ugh) email to some
[often large] number of web site subscribers.  Unfortunately, I'm
getting
lousy performance, running about 0.54 sec per email.

My partner has a mail script implemented on another machine and he's
running somewhere down around 0.10 sec per email, which is better but
still not very good for sending to 60k users.

The box (dual Xeon 2.2G with mirrored fast SCSI and 1G RAM) has plenty
of
horsepower, and it certainly shouldn't need more.  It's running RH 7.3
(Valhalla) with 2.4.20 on ext3 and has qmail installed as its MTA.

It seems to be the mail() call itself, because I can make a system call
(system, exec, passthru) to just echo the current data and it rips
through my list in nothin' flat.  So how do I tune mail() to make it
faster?  Or do I need to give up and call qmail-inject directly?


TIA & HAND

:-D
-- 
David T-G  * There is too much animal courage in 
(play) [EMAIL PROTECTED] * society and not sufficient moral
courage.
(work) [EMAIL PROTECTED]  -- Mary Baker Eddy, "Science and
Health"
http://justpickone.org/davidtg/  Shpx gur Pbzzhavpngvbaf Qrprapl
Npg!

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



RE: [PHP] Speed up MySQL

2003-06-27 Thread Aaron Gould
Read these mysql.com doc pages:

http://www.mysql.com/doc/en/MySQL_indexes.html
http://www.mysql.com/doc/en/CREATE_INDEX.html

--
Aaron Gould
Web Developer
Parts Canada
[EMAIL PROTECTED]

 

-Original Message-
From: Erich Kolb [mailto:[EMAIL PROTECTED] 
Sent: June 27, 2003 3:56 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Speed up MySQL


Can anyone offer some suggestions as to how I can speed up MySQL query
results?  I have a simple database with 3 fields in 1 table.  The thing is
that there are over 11 million records.  Average query time is about 25
seconds.  The machine itself is pretty fast(P4 1.8ghz/ 1gb ram).  Any
suggestions would be great!



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


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



Re: [PHP] Speed concerns with OOP and PHP4

2003-01-16 Thread Maxim Maletsky

"John Wells" <[EMAIL PROTECTED]> wrote... :

> I'm working on a large VB/Sql Server to Php/Postgresql conversion (approx.
> 60k lines of code).

First of all, VB is precompiled and PHP is not. This will already be
slower. So, you gonna need to create a logic that loads only the
necessary classes for every request. In VB you wouldn't probably need it.

> I'd like to design this thing as OO as possible, because I think
> ultimately it leads to better, more extendable and readable software. 

Good idea.

> However, since php does the whole copy thing with objects, I'm a little
> concerned.
>
> Is this "deficiency" on the part of PHP 4 something I should be concerned
> about?

Depends al on the logic you will give to it.

> If I have a 60k loc fully object-oriented php app with a large
> amount (approx. 500 or so) queries to a db, am I making a mistake by going
> OO? 

500 queries wan't really matter because it has few to do with OO/PHP.
60k of code, if all together on the same request will be definitely slow.
So, make sure that *only* the required classes are loaded on each
execution.


--
Maxim Maletsky
[EMAIL PROTECTED]



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




Re: [PHP] speed comparison

2002-11-19 Thread Marek Kilimajer
I like to see html highlighting, so I prefer first method, but for some 
small snippets I also use echo

Ernest E Vogelsinger wrote:

As Maxim pointed out a couple of days ago, this is just a matter of
nanosecs, it shouldn't be really noticeable from performance.

The fastest was to display non-PHP output is to escape from PHP and enter
plain HTML, like
   $a = 'World';
   ?>
   Hello !
   

This is quite ugly to read and write, and it prohibits to separate content
from output. So the next fast way to output would be
   echo 'Hello World!';
Note the single quotes - they are (_very_slightly_) faster than double quotes.

If you need to display variables you must revert to
   echo "Hello $a!";
to parse the string (note the double quotes here).

I would always prefer to have to buy a faster server and use the second or
third method than having to escape from PHP for any output, for what it's
worth.


 



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




Re: [PHP] speed comparison

2002-11-18 Thread Jeff Bluemel
I have not problem displaying variable - I do it all over my webpage, or how
to handle them.  you may want to check out my post above that has a weblink
to the project, and a better explanation of exactly what I am doing.

"Ernest E Vogelsinger" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> As Maxim pointed out a couple of days ago, this is just a matter of
> nanosecs, it shouldn't be really noticeable from performance.
>
> The fastest was to display non-PHP output is to escape from PHP and enter
> plain HTML, like
> $a = 'World';
> ?>
> Hello !
> 
> This is quite ugly to read and write, and it prohibits to separate content
> from output. So the next fast way to output would be
> echo 'Hello World!';
> Note the single quotes - they are (_very_slightly_) faster than double
quotes.
>
> If you need to display variables you must revert to
> echo "Hello $a!";
> to parse the string (note the double quotes here).
>
> I would always prefer to have to buy a faster server and use the second or
> third method than having to escape from PHP for any output, for what it's
> worth.
>
>
> --
>>O Ernest E. Vogelsinger
>(\) ICQ #13394035
> ^ http://www.vogelsinger.at/
>



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




Re: [PHP] speed comparison

2002-11-18 Thread Jeff Bluemel
depends on my situation, but I use both techniques at times...


"Justin French" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> I think the difference would be immeasurable, but to me, I think it would
> make sense if PHP didn't have to parse plain HTML...
>
> So IMHO,
>
> 
>
> /should/ be slightly quicker than
>
> {$foo}"; ?>
>
> The general consensus on the list seems to be "go with whichever one you
are
> more comfortable with, is more readable, and faster to write.
>
>
> Justin
>
>
> on 19/11/02 10:39 AM, Chris Edwards ([EMAIL PROTECTED]) wrote:
>
> > Which would run faster and generate less load on the server, or does it
> > matter:
> >
> >  >
> > $output = "
> >  > ...
> > ...html
> >
> >  $name $phone ...
> > ";
> >
> > echo $output;
> > ?>
> >
> > --  OR -
> >
> >  > ...
> > ...
> >  ... 
> > ..
> > 
> >
> > I find it sucks to try and put all the php tags around stuff, so I just
> > include it all.
> >
> > --
> > Chris Edwards
> > Web Application Developer
> > Outer Banks Internet, Inc.
> > 252-441-6698
> > [EMAIL PROTECTED]
> > http://www.OuterBanksInternet.com
> >
>
> Justin French
> 
> http://Indent.com.au
> Web Developent &
> Graphic Design
> 
>



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




Re: [PHP] speed comparison

2002-11-18 Thread Ernest E Vogelsinger
As Maxim pointed out a couple of days ago, this is just a matter of
nanosecs, it shouldn't be really noticeable from performance.

The fastest was to display non-PHP output is to escape from PHP and enter
plain HTML, like
$a = 'World';
?>
Hello !
Hello World!';
Note the single quotes - they are (_very_slightly_) faster than double quotes.

If you need to display variables you must revert to
echo "Hello $a!";
to parse the string (note the double quotes here).

I would always prefer to have to buy a faster server and use the second or
third method than having to escape from PHP for any output, for what it's
worth.


-- 
   >O Ernest E. Vogelsinger 
   (\) ICQ #13394035 
^ http://www.vogelsinger.at/



Re: [PHP] speed comparison

2002-11-18 Thread Justin French
I think the difference would be immeasurable, but to me, I think it would
make sense if PHP didn't have to parse plain HTML...

So IMHO,



/should/ be slightly quicker than

{$foo}"; ?>

The general consensus on the list seems to be "go with whichever one you are
more comfortable with, is more readable, and faster to write.


Justin


on 19/11/02 10:39 AM, Chris Edwards ([EMAIL PROTECTED]) wrote:

> Which would run faster and generate less load on the server, or does it
> matter:
> 
>  
> $output = "
>  ...
> ...html
> 
>  $name $phone ...
> ";
> 
> echo $output;
> ?>
> 
> --  OR -
> 
>  ...
> ...
>  ... 
> ..
> 
> 
> I find it sucks to try and put all the php tags around stuff, so I just
> include it all.
> 
> --
> Chris Edwards
> Web Application Developer
> Outer Banks Internet, Inc.
> 252-441-6698
> [EMAIL PROTECTED]
> http://www.OuterBanksInternet.com
> 

Justin French

http://Indent.com.au
Web Developent & 
Graphic Design



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




Re: [PHP] Speed issues.

2002-07-28 Thread Yves Vrancken

Thanks for the help, guys . I appreciate it. And Bas, thanks for that link.
Interesting material for a novice PHP-user as myself.

Yves Vrancken



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




RE: [PHP] Speed issues.

2002-07-28 Thread John Holmes

> I am new to PHP and trying to implement some PHP and MySQL on my
website.
> My
> website has a lot of tables and inside some of those tables, I want to
> display information that is drawn out of the MySQL database using PHP.
I
> was
> wondering what goes faster:
> 
> (A). Building the whole page normally up in HTML, doing the usual

>  and so forth, and then inside the  calling up the PHP in
order to
> display the information. For example:   
> 
> (B). Doing everything in the PHP document, also the 'building' of the
> tables, and then including the PHP script in the main page. For
example
> using printf("  and so forth.

(A) will be faster, generally. Plus it's easier to read and find the PHP
snippets in the HTML, than it is to read an entire page of print/echo
statements. And it'll generally open neatly in a graphical HTML editor,
too.

---John Holmes...


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




Re: [PHP] Speed issues.

2002-07-28 Thread Bas Jobsen

Hello,

You can also find something about your questions on:
http://www.php9.com/index.php/section/articles/name/PHP%20Guidelines

I had tested out by printing (repeated times):
1) echo ''.$k.': hallo '.$string.', dit is het'."\n";
2) echo "$k: hallo $string, dit is het"."\n";
3) ?>: hallo , dit is het 

Best regards,

Bas Jobsen


Op zondag 28 juli 2002 09:56, schreef Yves Vrancken:
> Greetings,
>
> I am new to PHP and trying to implement some PHP and MySQL on my website.
> My website has a lot of tables and inside some of those tables, I want to
> display information that is drawn out of the MySQL database using PHP. I
> was wondering what goes faster:
>
> (A). Building the whole page normally up in HTML, doing the usual 
>  and so forth, and then inside the  calling up the PHP in order to
> display the information. For example:   
>
> (B). Doing everything in the PHP document, also the 'building' of the
> tables, and then including the PHP script in the main page. For example
> using printf("  and so forth.
>
> Thanks,
>
> Yves Vrancken

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




Re: [PHP] Speed issues.

2002-07-28 Thread Yves Vrancken

I didn't expect it to make too much of a difference. Thank you for your
answer.

Yves Vrancken


"Justin French" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> I haven't noticed ANY performance hit by skipping in and out of PHP and
HTML
> when it suits me.
>
> I imagine there *might* be a slight performance hit if you were building a
> LOT of table information with print or echo or printf, but the general
> answer to your question is usually "whatever suits you better".
>
> You could run some comparison tests with a microtimer to see what
happens...
>
> I doubt on a 50-100K HTML page that you could notice the difference,
unless
> the site or server got S**TLOADS of hits.
>
>
> Justin French
>
>
>
> on 28/07/02 5:56 PM, Yves Vrancken ([EMAIL PROTECTED]) wrote:
>
> > Greetings,
> >
> > I am new to PHP and trying to implement some PHP and MySQL on my
website. My
> > website has a lot of tables and inside some of those tables, I want to
> > display information that is drawn out of the MySQL database using PHP. I
was
> > wondering what goes faster:
> >
> > (A). Building the whole page normally up in HTML, doing the usual

> >  and so forth, and then inside the  calling up the PHP in order
to
> > display the information. For example:   
> >
> > (B). Doing everything in the PHP document, also the 'building' of the
> > tables, and then including the PHP script in the main page. For example
> > using printf("  and so forth.
> >
> > Thanks,
> >
> > Yves Vrancken
> >
> >
>



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




Re: [PHP] Speed issues.

2002-07-28 Thread Justin French

I haven't noticed ANY performance hit by skipping in and out of PHP and HTML
when it suits me.

I imagine there *might* be a slight performance hit if you were building a
LOT of table information with print or echo or printf, but the general
answer to your question is usually "whatever suits you better".

You could run some comparison tests with a microtimer to see what happens...

I doubt on a 50-100K HTML page that you could notice the difference, unless
the site or server got S**TLOADS of hits.


Justin French



on 28/07/02 5:56 PM, Yves Vrancken ([EMAIL PROTECTED]) wrote:

> Greetings,
> 
> I am new to PHP and trying to implement some PHP and MySQL on my website. My
> website has a lot of tables and inside some of those tables, I want to
> display information that is drawn out of the MySQL database using PHP. I was
> wondering what goes faster:
> 
> (A). Building the whole page normally up in HTML, doing the usual 
>  and so forth, and then inside the  calling up the PHP in order to
> display the information. For example:   
> 
> (B). Doing everything in the PHP document, also the 'building' of the
> tables, and then including the PHP script in the main page. For example
> using printf("  and so forth.
> 
> Thanks,
> 
> Yves Vrancken
> 
> 


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




Re: [PHP] Speed Question

2002-07-19 Thread JJ Harrison

thx
"Jason Wong" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> On Thursday 18 July 2002 19:32, JJ Harrison wrote:
> > if I do this:
> >
> > if(validate($_POST['password'], $_POST['username']) != 0)
> > echo validate($_POST['password'], $_POST['username']);
> >
> > will it execute the function twice or use the same result twice?
>
> Function executes twice.
>
> > would it be (slightly) faster to do this:
> >
> > $uid = validate($_POST['password'], $_POST['username'])
> > if($uid != 0)
> > echo $uid);
>
> Probably.
>
> --
> Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
> Open Source Software Systems Integrators
> * Web Design & Hosting * Internet & Intranet Applications Development *
>
> /*
> If fifty million people say a foolish thing, it's still a foolish thing.
> -- Bertrand Russell
> */
>



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




Re: [PHP] Speed Question

2002-07-19 Thread Jason Wong

On Thursday 18 July 2002 19:32, JJ Harrison wrote:
> if I do this:
>
> if(validate($_POST['password'], $_POST['username']) != 0)
> echo validate($_POST['password'], $_POST['username']);
>
> will it execute the function twice or use the same result twice?

Function executes twice.

> would it be (slightly) faster to do this:
>
> $uid = validate($_POST['password'], $_POST['username'])
> if($uid != 0)
> echo $uid);

Probably.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *

/*
If fifty million people say a foolish thing, it's still a foolish thing.
-- Bertrand Russell
*/


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




Re: [PHP] Speed tests? RAM usage displays?

2002-06-21 Thread Pekka Saarinen

At 6/21/2002, you wrote:
>PS> What about execution time in ms (with breakpoints)?
>PS> And is there way to measure MySQL query speed in ms?
>
>u can use microtime function
>
> function getMicrotime()
> {
> list($usec, $sec) = explode(" ",microtime());
> return ((float)$usec + (float)$sec);
> }
>
>in your head of your script than call:
>
>$start = getMicrotime();
>
>and then in the end of script
>
>$stop = getMicrotime();
>$diff = $stop - $start;
>echo "Execution time was: ".$diff;

Thanks! That was really useful. I placed it around the biggest/most complex 
MySQL query on the code and found out that the biggest slow down there was 
due ORDER BY command (and not LIKE I thought was). So, I removed the ORDER 
BY and did array sorting using PHP (PHP did it in less than a millisecond) 
and got this query speed down from .25s to .07s

Optimising can be so much fun! ;)

Pekka
http://photography-on-the.net/



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




Re: [PHP] Speed tests? RAM usage displays?

2002-06-20 Thread Uros Gruber

Hi!

Thursday, June 20, 2002, 10:56:40 PM, you wrote:

PS> Is there any way to determine script's memory usage?

When you configure and compile you have some option
--with-memory-limit  something like that and then add

\"%{mod_php_memory_usage}n\"

in you http.conf of Apache where you define how log files
look like.


PS> What about execution time in ms (with breakpoints)?
PS> And is there way to measure MySQL query speed in ms?

u can use microtime function

function getMicrotime()
{
list($usec, $sec) = explode(" ",microtime()); 
return ((float)$usec + (float)$sec); 
}

in your head of your script than call:

$start = getMicrotime();

and then in the end of script

$stop = getMicrotime();
$diff = $stop - $start;
echo "Execution time was: ".$diff;

You can also use Benchmark module from PEAR there is also
support for markers.

-- 
lp,
 Urosmailto:[EMAIL PROTECTED]


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




Re: [PHP] Speed tests? RAM usage displays?

2002-06-20 Thread 1LT John W. Holmes

> Is there any way to determine script's memory usage?

Depends on your web server. There is a way in apache. Rasmus answered this
same question for me a couple weeks ago, look through the archives. I saw an
option in IIS to put memory usage into the logs, that may work, too.

> What about execution time in ms (with breakpoints)?

Plenty of classes around that'll do basic timing, but not sure on the
breakpoint. shouldn't be that hard to implement, though. PEAR has a class to
do it, I think, or search phpclasses.org

> And is there way to measure MySQL query speed in ms?

Not really. I really wish there was a function to return query time, but
there isn't. Best you can do is take a timestamp before you issue the query
and one afterwards. That's not going to be the actual query time, but it'll
give you an idea. Best way to implement that is to make a wrapper for
mysql_query()

---John Holmes...


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




[PHP] Re: php-speed

2002-06-13 Thread Leon Mergen


"Philipp Melab" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Yes, Ithought that embedding must be faster too. But I was confused
because
> in nearly every PHP-Beginner Tutorial/Book I've seen the Hello-World
> Example looks like this:
>
>  echo "";
> echo "";
> echo "...";
> echo "";
>
> echo "";
> echo "Hello World!";
> echo "";
> echo "";
> ?>

Hello Philipp,

I think that must be because it's the most easy to explain... It's very easy
for people having experience with Perl, since Perl works that way...

I personally only use templates (I even wrote a caching template engine) ,
so that would be the last step in layout I think ;)

Regards,

Leon Mergen



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




[PHP] Re: php-speed

2002-06-13 Thread Philipp Melab

Yes, Ithought that embedding must be faster too. But I was confused because 
in nearly every PHP-Beginner Tutorial/Book I've seen the Hello-World 
Example looks like this:

";
echo "";
echo "...";
echo ""; 

echo "";
echo "Hello World!";
echo "";
echo "";
?>

funny, isn't it?

yours, Philipp

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




[PHP] Re: php-speed

2002-06-13 Thread Philipp Melab

Yes


Leon Mergen wrote:

> 
> "Philipp Melab" <[EMAIL PROTECTED]> wrote in message
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
>> - embedding PHP in HTML
>> - or printing HTML via PHP
> 
> With embedding PHP in HTML, do you mean using server side includes or do
> you mean by having a .php file and having a layout like this:
> 
> 
> 
> 
> 
>  code();
> ?>
> 
> 
> 
> Regards,
> 
> Leon Mergen


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




[PHP] Re: php-speed

2002-06-13 Thread Leon Mergen


"Philipp Melab" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> - embedding PHP in HTML
> - or printing HTML via PHP

With embedding PHP in HTML, do you mean using server side includes or do you
mean by having a .php file and having a layout like this:









Regards,

Leon Mergen



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




Re: [PHP] Speed comparison of PHP vs. PERL (not conclusive)

2002-06-01 Thread Jason Wong

On Sunday 02 June 2002 02:12, Mark Charette wrote:
> From: Jason Wong [mailto:[EMAIL PROTECTED]]
>
> >Try comparing reading 10K rows from a DB using Perl and PHP would be a
> > more useful benchmark.
>
> ---
> When's the last time you wrote a Web page that needed 10K rows displayed?

Never.

Perhaps you didn't follow the thread. The gist of it was that someone was 
concerned that the code which does looping in PHP was slow (compared to Perl) 
and would like to see it increased in speed. What I was trying to point out 
was that the time it takes to do the loop is (probably) insignificant 
compared to whatever is happening /inside/ the loop. Thus my suggestion. Of 
course no (sensible) person would want to display 10K rows in a web-page 
anymore than one would want to display all the prime numbers from 1 to 10 
trillion. However in the context of what PHP is (usually) used for it is a 
better measure of speed and more relevant than calculating those prime 
numbers.

But it would be hardly useful to compare the speed of retrieval of a single 
row as other factors would make it unreliable. How many benchmarks do you see 
where the operation is only performed once? I would say not many.

> Writing good _and relevant_ benchmarks is one of the more difficult things
> to do in CS. Personally, I look at the time it takes me to code and debug
> things since that's the most expensive part of the cost equation to my
> customers - hardware's cheap compared to me. I can get something of
> production quality up and running on PHP much faster than I can in Perl -
> probably due to 20 years of programming in C - so my customers are happy.
> Considering that 95% of the time the bottleneck is the bandwidth, not the
> application code, and the other 5% of the bottleneck is in the database
> application section, my customers don't demand any artificial language
> benchmarks.

And I agree, the MS method of throwing in hardware to mask inefficient 
programming is quite cost-effective. That is why today my 128MB/500MHz PIII 
system feels just a nippy as my 8MB/8MHz Amiga did 10 years ago ;-)

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *

/*
Take everything in stride.  Trample anyone who gets in your way.
*/


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




RE: [PHP] Speed comparison of PHP vs. PERL (not conclusive)

2002-06-01 Thread Mark Charette

From: Jason Wong [mailto:[EMAIL PROTECTED]]
>Try comparing reading 10K rows from a DB using Perl and PHP would be a more
>useful benchmark.
---
When's the last time you wrote a Web page that needed 10K rows displayed?

Writing good _and relevant_ benchmarks is one of the more difficult things
to do in CS. Personally, I look at the time it takes me to code and debug
things since that's the most expensive part of the cost equation to my
customers - hardware's cheap compared to me. I can get something of
production quality up and running on PHP much faster than I can in Perl -
probably due to 20 years of programming in C - so my customers are happy.
Considering that 95% of the time the bottleneck is the bandwidth, not the
application code, and the other 5% of the bottleneck is in the database
application section, my customers don't demand any artificial language
benchmarks.

Mark C.



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




Re: [PHP] Speed comparison of PHP vs. PERL (not conclusive)

2002-05-31 Thread Jason Wong

On Saturday 01 June 2002 06:20, Daniel Grace wrote:
> > > language would in many cases show PHP to be slower simply because it's
> > > looping code is slow? [...]
>
> It is typical usage, yes, but the conversation that gave me the idea to do
> the quick speed comparison was the idea that PHP can be used for more than
> just web-scripting. I have a couple maintenance PHP scripts that run
> command-line (usually management/maintenance programs for a large PHP+MySQL
> app), and there is the entire php-gtk project as well. (The whole
> conversation started because I pondered the idea of maybe writing a Win32
> API extension for PHP)
>
> And a loop in PHP isn't exactly non-typical. I'd need more fingers and toes
> to count how many times I've wrote "while($row =
> mysql_fetch_assoc($result)) { ... }"

I would have thought that any inherent 'slowness' of looping code is 
insignificant compared to the time it takes to retrieve a row from a db.

Try comparing reading 10K rows from a DB using Perl and PHP would be a more 
useful benchmark.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *

/*
Thank God a million billion times you live in Texas.
*/


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




Re: [PHP] Speed comparison of PHP vs. PERL (not conclusive)

2002-05-31 Thread Ilia A.

I agree that in most cases it makes more sence at seing the webpages per 
second benchmark rather then a timing of some artibtrary benchmarks that for 
example seeing how long it take to pick prime numbers. Since in the end it 
matters how quickly you can get the data to the user, in case of perl 
programs there would be the overhead of spawning a cgi program, (unless 
mod_perl is used) which would negate much of the speed improvment gained by 
Perl.
All that said, loops are very very common in PHP, and are used with virtually 
in any script that uses a database wether it be SQL or flatfile to loop 
through the result set. 
Since this appears to be a known performance issue, perphaps it is something 
the PHP Development team could consider improving for PHP 5.0

Ilia

On May 31, 2002 06:00 pm, Rasmus Lerdorf wrote:
> Sure, you could put it that way.  When benchmarking something you really
> should benchmark stuff that you actually care about.  Benchmark PHP
> spewing out a web page after making a couple of SQL queries, for example.
> That's typical usage, so that is what you should benchmark.  Very few PHP
> scripts are going to loop a couple of hundred thousand times to do
> something.
>
> -Rasmus
>
> On Fri, 31 May 2002, Ilia A. wrote:
> > Does this mean that running a comparison benchmarks between PHP and any
> > other language would in many cases show PHP to be slower simply because
> > it's looping code is slow? Unless, timing is done on a speed of PHP being
> > able to spew out webpages via the webserver with a webserver benchmark
> > tool such as apachebench?
> >
> > Wouldn't that cause any benchmarks trying to guage the speed of PHP
> > virtually meaningless because of the 'loop' overhead, which is clearly
> > great enough to make PHP way slower in comparison to Perl for example?
> >
> > Ilia
> >
> > On May 31, 2002 05:38 pm, Rasmus Lerdorf wrote:
> > > Not very surprising.  Perl's looping code has always ben faster than
> > > PHP's.  Highly iterative loops is really not what PHP is geared for. 
> > > You are not going to write a Mandelbrot algorithm in PHP.  You write it
> > > in C and drop in a super-quick extension into PHP and call
> > > mandelbrot().
> > >
> > > -Rasmus
> > >
> > > On Fri, 31 May 2002, Daniel Grace wrote:
> > > > This all started in a little debate between me and a friend of mine
> > > > who I think is as much a PERL zealot as I am a PHP zealot (I was
> > > > briefly pondering the idea of a Win32 API extension for PHP), and the
> > > > results were rather surprising -- to me, at least..
> > > >
> > > > It all started when I asked him what PERL had that PHP didn't in
> > > > terms of language (not taking community, modules, etc. into an
> > > > account). We both believed that the two would be very similiar in
> > > > speed -- he thought PERL would be a little faster but not enough to
> > > > be noticeable. For the first test, I went with a program that
> > > > computed prime numbers between 2 and 1, using no form of caching
> > > > or anything like that. I gave him the PHP source with the task of
> > > > writing something in PERL as close to the original PHP source as
> > > > possible. The results:
> > > >
> > > > (note: I didn't know if PERL had PHP's continue(2), hence why I used
> > > > the slightly less efficient method here:)
> > > >
> > > > prime.php:
> > > > #!/usr/bin/php -q
> > > >  > > >
> > > > echo "2\n";
> > > >
> > > > for($check = 3 ; $check < 1 ; $check += 2) {
> > > > $prime = 1;
> > > > $half = (int) $check / 2;
> > > > for($against = 2 ; $against <= $half ; ++$against) {
> > > > if(!($check % $against)) {
> > > > $prime = 0;
> > > > break;
> > > > }
> > > > }
> > > > if($prime) echo "$check\n";
> > > > }
> > > >
> > > >
> > > > prime.pl:
> > > > #!/usr/bin/perl
> > > > # print "2\n";
> > > > my $num;
> > > > for ($num = 3; $num < 1; $num+=2)
> > > > {
> > > > my $prime = 1;
> > > > for $check ( 2 .. int($num/2) )
> > > > {
> > > > if ($num % $check == 0)
> > > > {
> > > > $prime = 0;
> > > > last;
> > > > }
> > > > }
> > > > #print "$num\n" if $prime;
> > > > }
> > > >
> > > >
> > > > The test machine is an AMD Duron 700 MHz using an a-bit KT7A
> > > > motherboard with 256 MB of PC100 SDRAM. uname -a reports "Linux
> > > > ulysses.venura.net 2.4.17-ulysses1 #1 Sat Dec 29 14:44:46 PST 2001
> > > > i686 unknown", PHP 4.2.1 was configured with
> > > > --enable-inline-optimization --prefix=[somepath], PERL 5.6.1 was
> > > > configured with -O3 (among other options) (PHP compiles with -g -O2
> > > > with no 'easy' (at-configure-time) way to change that, to my
> > > > knowledge).
> > > >
> > > > Both programs were ran once normally to verify they actually
> > > > generated prime numbers, and then the 

Re: [PHP] Speed comparison of PHP vs. PERL (not conclusive)

2002-05-31 Thread Daniel Grace


"Rasmus Lerdorf" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Sure, you could put it that way.  When benchmarking something you really
> should benchmark stuff that you actually care about.  Benchmark PHP
> spewing out a web page after making a couple of SQL queries, for example.
> That's typical usage, so that is what you should benchmark.  Very few PHP
> scripts are going to loop a couple of hundred thousand times to do
> something.
>
> -Rasmus
>
> On Fri, 31 May 2002, Ilia A. wrote:
>
> > Does this mean that running a comparison benchmarks between PHP and any
other
> > language would in many cases show PHP to be slower simply because it's
> > looping code is slow? [...]


It is typical usage, yes, but the conversation that gave me the idea to do
the quick speed comparison was the idea that PHP can be used for more than
just web-scripting. I have a couple maintenance PHP scripts that run
command-line (usually management/maintenance programs for a large PHP+MySQL
app), and there is the entire php-gtk project as well. (The whole
conversation started because I pondered the idea of maybe writing a Win32
API extension for PHP)

And a loop in PHP isn't exactly non-typical. I'd need more fingers and toes
to count how many times I've wrote "while($row = mysql_fetch_assoc($result))
{ ... }"

-- Daniel Grace



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




Re: [PHP] Speed comparison of PHP vs. PERL (not conclusive)

2002-05-31 Thread Rasmus Lerdorf

Sure, you could put it that way.  When benchmarking something you really
should benchmark stuff that you actually care about.  Benchmark PHP
spewing out a web page after making a couple of SQL queries, for example.
That's typical usage, so that is what you should benchmark.  Very few PHP
scripts are going to loop a couple of hundred thousand times to do
something.

-Rasmus

On Fri, 31 May 2002, Ilia A. wrote:

> Does this mean that running a comparison benchmarks between PHP and any other
> language would in many cases show PHP to be slower simply because it's
> looping code is slow? Unless, timing is done on a speed of PHP being able to
> spew out webpages via the webserver with a webserver benchmark tool such as
> apachebench?
>
> Wouldn't that cause any benchmarks trying to guage the speed of PHP virtually
> meaningless because of the 'loop' overhead, which is clearly great enough to
> make PHP way slower in comparison to Perl for example?
>
> Ilia
>
> On May 31, 2002 05:38 pm, Rasmus Lerdorf wrote:
> > Not very surprising.  Perl's looping code has always ben faster than
> > PHP's.  Highly iterative loops is really not what PHP is geared for.  You
> > are not going to write a Mandelbrot algorithm in PHP.  You write it in C
> > and drop in a super-quick extension into PHP and call mandelbrot().
> >
> > -Rasmus
> >
> > On Fri, 31 May 2002, Daniel Grace wrote:
> > > This all started in a little debate between me and a friend of mine who I
> > > think is as much a PERL zealot as I am a PHP zealot (I was briefly
> > > pondering the idea of a Win32 API extension for PHP), and the results
> > > were rather surprising -- to me, at least..
> > >
> > > It all started when I asked him what PERL had that PHP didn't in terms of
> > > language (not taking community, modules, etc. into an account). We both
> > > believed that the two would be very similiar in speed -- he thought PERL
> > > would be a little faster but not enough to be noticeable. For the first
> > > test, I went with a program that computed prime numbers between 2 and
> > > 1, using no form of caching or anything like that. I gave him the PHP
> > > source with the task of writing something in PERL as close to the
> > > original PHP source as possible. The results:
> > >
> > > (note: I didn't know if PERL had PHP's continue(2), hence why I used the
> > > slightly less efficient method here:)
> > >
> > > prime.php:
> > > #!/usr/bin/php -q
> > >  > >
> > > echo "2\n";
> > >
> > > for($check = 3 ; $check < 1 ; $check += 2) {
> > > $prime = 1;
> > > $half = (int) $check / 2;
> > > for($against = 2 ; $against <= $half ; ++$against) {
> > > if(!($check % $against)) {
> > > $prime = 0;
> > > break;
> > > }
> > > }
> > > if($prime) echo "$check\n";
> > > }
> > >
> > >
> > > prime.pl:
> > > #!/usr/bin/perl
> > > # print "2\n";
> > > my $num;
> > > for ($num = 3; $num < 1; $num+=2)
> > > {
> > > my $prime = 1;
> > > for $check ( 2 .. int($num/2) )
> > > {
> > > if ($num % $check == 0)
> > > {
> > > $prime = 0;
> > > last;
> > > }
> > > }
> > > #print "$num\n" if $prime;
> > > }
> > >
> > >
> > > The test machine is an AMD Duron 700 MHz using an a-bit KT7A motherboard
> > > with 256 MB of PC100 SDRAM. uname -a reports "Linux ulysses.venura.net
> > > 2.4.17-ulysses1 #1 Sat Dec 29 14:44:46 PST 2001 i686 unknown", PHP 4.2.1
> > > was configured with --enable-inline-optimization --prefix=[somepath],
> > > PERL 5.6.1 was configured with -O3 (among other options) (PHP compiles
> > > with -g -O2 with no 'easy' (at-configure-time) way to change that, to my
> > > knowledge).
> > >
> > > Both programs were ran once normally to verify they actually generated
> > > prime numbers, and then the bash "time" command was used to time them,
> > > piping their output to /dev/null to prevent that from being a factor. I
> > > re-ran the tests a few times with results consistently similiar to those
> > > listed here:
> > >
> > > The results:
> > >
> > > [dewin@ulysses profiling]$ time ./prime.php > /dev/null
> > >
> > > real0m14.465s
> > > user0m8.610s
> > > sys 0m0.070s
> > >
> > > [dewin@ulysses profiling]$ time ./prime.pl > /dev/null
> > >
> > > real0m5.302s
> > > user0m3.180s
> > > sys 0m0.000s
> > >
> > >
> > >
> > > A second system, with PHP compiled the same way and a PERL 5.6.1 binary
> > > distributed by Red Hat, 1.2 ghz with 442 MB of RAM:
> > >
> > > [root@mrr-016 law]# time ./prime.pl > /dev/null
> > > real 0m2.078s
> > > user 0m2.040s
> > > sys 0m0.010s
> > >
> > > [root@mrr-016 law]# time ./prime.php > /dev/null
> > > real 0m5.512s
> > > user 0m5.430s
> > > sys 0m0.010s
> > >
> > >
> > > Comments? I was expecting the numbers to be very similiar -- rather
> > > shocked that the PERL e

Re: [PHP] Speed comparison of PHP vs. PERL (not conclusive)

2002-05-31 Thread Ilia A.

Does this mean that running a comparison benchmarks between PHP and any other 
language would in many cases show PHP to be slower simply because it's 
looping code is slow? Unless, timing is done on a speed of PHP being able to 
spew out webpages via the webserver with a webserver benchmark tool such as 
apachebench?

Wouldn't that cause any benchmarks trying to guage the speed of PHP virtually 
meaningless because of the 'loop' overhead, which is clearly great enough to 
make PHP way slower in comparison to Perl for example?

Ilia

On May 31, 2002 05:38 pm, Rasmus Lerdorf wrote:
> Not very surprising.  Perl's looping code has always ben faster than
> PHP's.  Highly iterative loops is really not what PHP is geared for.  You
> are not going to write a Mandelbrot algorithm in PHP.  You write it in C
> and drop in a super-quick extension into PHP and call mandelbrot().
>
> -Rasmus
>
> On Fri, 31 May 2002, Daniel Grace wrote:
> > This all started in a little debate between me and a friend of mine who I
> > think is as much a PERL zealot as I am a PHP zealot (I was briefly
> > pondering the idea of a Win32 API extension for PHP), and the results
> > were rather surprising -- to me, at least..
> >
> > It all started when I asked him what PERL had that PHP didn't in terms of
> > language (not taking community, modules, etc. into an account). We both
> > believed that the two would be very similiar in speed -- he thought PERL
> > would be a little faster but not enough to be noticeable. For the first
> > test, I went with a program that computed prime numbers between 2 and
> > 1, using no form of caching or anything like that. I gave him the PHP
> > source with the task of writing something in PERL as close to the
> > original PHP source as possible. The results:
> >
> > (note: I didn't know if PERL had PHP's continue(2), hence why I used the
> > slightly less efficient method here:)
> >
> > prime.php:
> > #!/usr/bin/php -q
> >  >
> > echo "2\n";
> >
> > for($check = 3 ; $check < 1 ; $check += 2) {
> > $prime = 1;
> > $half = (int) $check / 2;
> > for($against = 2 ; $against <= $half ; ++$against) {
> > if(!($check % $against)) {
> > $prime = 0;
> > break;
> > }
> > }
> > if($prime) echo "$check\n";
> > }
> >
> >
> > prime.pl:
> > #!/usr/bin/perl
> > # print "2\n";
> > my $num;
> > for ($num = 3; $num < 1; $num+=2)
> > {
> > my $prime = 1;
> > for $check ( 2 .. int($num/2) )
> > {
> > if ($num % $check == 0)
> > {
> > $prime = 0;
> > last;
> > }
> > }
> > #print "$num\n" if $prime;
> > }
> >
> >
> > The test machine is an AMD Duron 700 MHz using an a-bit KT7A motherboard
> > with 256 MB of PC100 SDRAM. uname -a reports "Linux ulysses.venura.net
> > 2.4.17-ulysses1 #1 Sat Dec 29 14:44:46 PST 2001 i686 unknown", PHP 4.2.1
> > was configured with --enable-inline-optimization --prefix=[somepath],
> > PERL 5.6.1 was configured with -O3 (among other options) (PHP compiles
> > with -g -O2 with no 'easy' (at-configure-time) way to change that, to my
> > knowledge).
> >
> > Both programs were ran once normally to verify they actually generated
> > prime numbers, and then the bash "time" command was used to time them,
> > piping their output to /dev/null to prevent that from being a factor. I
> > re-ran the tests a few times with results consistently similiar to those
> > listed here:
> >
> > The results:
> >
> > [dewin@ulysses profiling]$ time ./prime.php > /dev/null
> >
> > real0m14.465s
> > user0m8.610s
> > sys 0m0.070s
> >
> > [dewin@ulysses profiling]$ time ./prime.pl > /dev/null
> >
> > real0m5.302s
> > user0m3.180s
> > sys 0m0.000s
> >
> >
> >
> > A second system, with PHP compiled the same way and a PERL 5.6.1 binary
> > distributed by Red Hat, 1.2 ghz with 442 MB of RAM:
> >
> > [root@mrr-016 law]# time ./prime.pl > /dev/null
> > real 0m2.078s
> > user 0m2.040s
> > sys 0m0.010s
> >
> > [root@mrr-016 law]# time ./prime.php > /dev/null
> > real 0m5.512s
> > user 0m5.430s
> > sys 0m0.010s
> >
> >
> > Comments? I was expecting the numbers to be very similiar -- rather
> > shocked that the PERL ended up being about 2.5x as fast as PHP was.
> >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php


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




Re: [PHP] Speed comparison of PHP vs. PERL (not conclusive)

2002-05-31 Thread Rasmus Lerdorf

Not very surprising.  Perl's looping code has always ben faster than
PHP's.  Highly iterative loops is really not what PHP is geared for.  You
are not going to write a Mandelbrot algorithm in PHP.  You write it in C
and drop in a super-quick extension into PHP and call mandelbrot().

-Rasmus

On Fri, 31 May 2002, Daniel Grace wrote:

> This all started in a little debate between me and a friend of mine who I
> think is as much a PERL zealot as I am a PHP zealot (I was briefly pondering
> the idea of a Win32 API extension for PHP), and the results were rather
> surprising -- to me, at least..
>
> It all started when I asked him what PERL had that PHP didn't in terms of
> language (not taking community, modules, etc. into an account). We both
> believed that the two would be very similiar in speed -- he thought PERL
> would be a little faster but not enough to be noticeable. For the first
> test, I went with a program that computed prime numbers between 2 and 1,
> using no form of caching or anything like that. I gave him the PHP source
> with the task of writing something in PERL as close to the original PHP
> source as possible. The results:
>
> (note: I didn't know if PERL had PHP's continue(2), hence why I used the
> slightly less efficient method here:)
>
> prime.php:
> #!/usr/bin/php -q
> 
> echo "2\n";
>
> for($check = 3 ; $check < 1 ; $check += 2) {
> $prime = 1;
> $half = (int) $check / 2;
> for($against = 2 ; $against <= $half ; ++$against) {
> if(!($check % $against)) {
> $prime = 0;
> break;
> }
> }
> if($prime) echo "$check\n";
> }
>
>
> prime.pl:
> #!/usr/bin/perl
> # print "2\n";
> my $num;
> for ($num = 3; $num < 1; $num+=2)
> {
> my $prime = 1;
> for $check ( 2 .. int($num/2) )
> {
> if ($num % $check == 0)
> {
> $prime = 0;
> last;
> }
> }
> #print "$num\n" if $prime;
> }
>
>
> The test machine is an AMD Duron 700 MHz using an a-bit KT7A motherboard
> with 256 MB of PC100 SDRAM. uname -a reports "Linux ulysses.venura.net
> 2.4.17-ulysses1 #1 Sat Dec 29 14:44:46 PST 2001 i686 unknown", PHP 4.2.1 was
> configured with --enable-inline-optimization --prefix=[somepath], PERL 5.6.1
> was configured with -O3 (among other options) (PHP compiles with -g -O2 with
> no 'easy' (at-configure-time) way to change that, to my knowledge).
>
> Both programs were ran once normally to verify they actually generated prime
> numbers, and then the bash "time" command was used to time them, piping
> their output to /dev/null to prevent that from being a factor. I re-ran the
> tests a few times with results consistently similiar to those listed here:
>
> The results:
>
> [dewin@ulysses profiling]$ time ./prime.php > /dev/null
>
> real0m14.465s
> user0m8.610s
> sys 0m0.070s
>
> [dewin@ulysses profiling]$ time ./prime.pl > /dev/null
>
> real0m5.302s
> user0m3.180s
> sys 0m0.000s
>
>
>
> A second system, with PHP compiled the same way and a PERL 5.6.1 binary
> distributed by Red Hat, 1.2 ghz with 442 MB of RAM:
>
> [root@mrr-016 law]# time ./prime.pl > /dev/null
> real 0m2.078s
> user 0m2.040s
> sys 0m0.010s
>
> [root@mrr-016 law]# time ./prime.php > /dev/null
> real 0m5.512s
> user 0m5.430s
> sys 0m0.010s
>
>
> Comments? I was expecting the numbers to be very similiar -- rather shocked
> that the PERL ended up being about 2.5x as fast as PHP was.
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>


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




RE: [PHP] Speed of Images from DB

2001-11-30 Thread Matthew Loff



It would be mighty handy for MySQL to have a binary file column type,
like Oracle, where the file was stored externally, outside of the rest
of the table data...  Anyone heard of any plans to implement this?


-Original Message-
From: Julio Nobrega Trabalhando
[mailto:[EMAIL PROTECTED]] 
Sent: Friday, November 30, 2001 12:18 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] Speed of Images from DB


> But that could be due to server capabilities of my ISP (if he has for
> example a high tech mysql-server and a relativly slow machine for
apache).

  Probaly :-)

  From this page:

http://www.mysql.com/information/presentations/presentation-oscon2000-20
0007
19/

  You can read on section 'General tips':

- Store BLOB's that you need to access as files in files. Store only the
file name in the database.

  But I guess it also depends on the image size.

--

Julio Nobrega

Don't eat the yellow snow.


"Stefan Rusterholz" <[EMAIL PROTECTED]> wrote in message
000701c179bb$33c4df30$3c01a8c0@quasimodo">news:000701c179bb$33c4df30$3c01a8c0@quasimodo...
> I did do that for a galery-script of myself. I don't have any numbers
if
> you'r looking for that but my personal impression was, that the
picture
> output from the mysql-db is actually faster than reading directly from
disk.
> But that could be due to server capabilities of my ISP (if he has for
> example a high tech mysql-server and a relativly slow machine for
apache).
>
> But with a quite fast mysql-server it shouldn't be a problem I think.
>
> And if it _would_ be a problem, I think there are still more positive
> aspects then negatives (easy handling, having stored all important
> informations together, fast searching of images with keywords and so
on)
>
> best regards
> Stefan Rusterholz, [EMAIL PROTECTED]
> --




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Speed of Images from DB

2001-11-30 Thread Julio Nobrega Trabalhando

> But that could be due to server capabilities of my ISP (if he has for
> example a high tech mysql-server and a relativly slow machine for apache).

  Probaly :-)

  From this page:

http://www.mysql.com/information/presentations/presentation-oscon2000-27
19/

  You can read on section 'General tips':

- Store BLOB's that you need to access as files in files. Store only the
file name in the database.

  But I guess it also depends on the image size.

--

Julio Nobrega

Don't eat the yellow snow.


"Stefan Rusterholz" <[EMAIL PROTECTED]> wrote in message
000701c179bb$33c4df30$3c01a8c0@quasimodo">news:000701c179bb$33c4df30$3c01a8c0@quasimodo...
> I did do that for a galery-script of myself. I don't have any numbers if
> you'r looking for that but my personal impression was, that the picture
> output from the mysql-db is actually faster than reading directly from
disk.
> But that could be due to server capabilities of my ISP (if he has for
> example a high tech mysql-server and a relativly slow machine for apache).
>
> But with a quite fast mysql-server it shouldn't be a problem I think.
>
> And if it _would_ be a problem, I think there are still more positive
> aspects then negatives (easy handling, having stored all important
> informations together, fast searching of images with keywords and so on)
>
> best regards
> Stefan Rusterholz, [EMAIL PROTECTED]
> --




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Speed of Images from DB

2001-11-30 Thread Stefan Rusterholz

I did do that for a galery-script of myself. I don't have any numbers if
you'r looking for that but my personal impression was, that the picture
output from the mysql-db is actually faster than reading directly from disk.
But that could be due to server capabilities of my ISP (if he has for
example a high tech mysql-server and a relativly slow machine for apache).

But with a quite fast mysql-server it shouldn't be a problem I think.

And if it _would_ be a problem, I think there are still more positive
aspects then negatives (easy handling, having stored all important
informations together, fast searching of images with keywords and so on)

best regards
Stefan Rusterholz, [EMAIL PROTECTED]
--
interaktion gmbh
Stefan Rusterholz
Zürichbergstrasse 17
8032 Zürich
--
T. +41 1 253 19 55
F. +41 1 253 19 56
W3 www.interaktion.ch
--
- Original Message -
From: "Jim Musil" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, November 30, 2001 4:47 PM
Subject: [PHP] Speed of Images from DB


>
> I've been searching for the best way to store images that would be
> used in a dynamic site. In this situation, a site admin would upload
> images via a php script. Obviously this creates several problems.
>
> To prevent naming problems, I have php name all the uploaded images
> and store the name in a mysql db. Then, when needed, php will query
> to get the name and insert the image name into the image tag. This
> has always seemed like an incomplete solution because it's hard to
> manage the files later.
>
> Using mySQL to do the whole thing is appealing. I've never tried
> storing the actual data in my mysql db. It seems like it would be too
> slow to query, transfer, and passthru.
>
> Does anyone have any wisdom on this subject?
>
>
> --
> Jim Musil
> -
> Multimedia Programmer
> Nettmedia
> -
> 212-629-0004
> [EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] SPEED: Apache module vs. compiled?

2001-09-18 Thread Michael A. Peters

On Tue, 18 Sep 2001 10:12:05 -0700
Camille Davis <[EMAIL PROTECTED]> wrote:

> Does anyone have any benchmarks or proof of a speed difference between 
> compiling PHP as an Apache APXS module, versus compiling it right into Apache?
> 
> I'm going to be using it on a virtual webhost with 400 domains on one 
> server, and good amount of traffic.  PHP used for *everything*.
> 
> Module would be easier to upgrade, (and is the default OpenBSD install), 
> but I've heard it affects performance slightly.
> 
> Any proof?  Or is this a myth?

I think its myth.
Anyway, if speed is your concern, Apache may not be the best option.
I believe Zeus is much faster, and I know thttpd is faster (though not as configurable)

I think probably the best thing to do if you are looking for free server software is 
to use Apache 2.x beta- I haven't yet, but I believe php builds against it just fine, 
and Apache 2.x has a lot of speed advantages over 1.3.x (or so I've been led to 
believe)

*snip*

-- 
-=-=-=-=-=-=-=-=-=-=-=-=-
Michael A. Peters
http://24.5.29.77:10080/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Speed of loding PHP pages

2001-07-12 Thread Alexander Skwar

So sprach »Aral Balkan« am 2001-07-11 um 14:59:44 -0400 :
> Personally, I couldn't be happier that Netscape won't be making browsers

Ah, so Microsoft also stopped making "operating systems"?

> anymore and I wish that trouble-some bug of an excuse for a browser would
> just go away :)

Well, Netscape 4 is not that nice, granted, but Mozilla rules!

Alexander Skwar
-- 
How to quote:   http://learn.to/quote (german) http://quote.6x.to (english)
Homepage:   http://www.digitalprojects.com   |   http://www.iso-top.de
   iso-top.de - Die günstige Art an Linux Distributionen zu kommen
Uptime: 21 hours 36 minutes

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Speed of loding PHP pages

2001-07-11 Thread Aral Balkan

>> Netscape is notoriously slug-like when it comes to loading large tables
(i.e. the output of phpinfo()).

A way around this is to break up large tables into numerous smaller ones (or
at least have one table at the top that displays something so that the user
doesn't think that things have gone awry).

Personally, I couldn't be happier that Netscape won't be making browsers
anymore and I wish that trouble-some bug of an excuse for a browser would
just go away :)

Aral
__
([EMAIL PROTECTED])
New Media Producer, Kismia, Inc.
([EMAIL PROTECTED])
Adj. Prof., American University
¯¯



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Speed of loding PHP pages

2001-07-11 Thread scott [gts]

well... ahem... netscape 4.x is 1996-97 technology.

4-5 years since the last major release of netscape
is an eternity of internet time in those
years, microsoft has been pouring money and time
into their browser no duh it kicks the crap
outta netscape 4.x   :)

> -Original Message-
> From: Inércia Sensorial [mailto:[EMAIL PROTECTED]]
> Subject: Re: [PHP] Speed of loding PHP pages
>
>
>
>   No. It also depends on the internal engine used by the browser to
> 'contruct' the elements. On Windows plataforms, Netscape are slower to
> render cached pages. But IE has an advantage, it is built around some native
> windows functionalities, one of the reasons it is faster. I don't know for
> other plataforms tought.
>
>   Anyway, Opera is the fastest :-) Also the new engine from mozilla (not NS
> 6.0), is fast, but since it is not to be considerable a final release, even
> most recent ones, I can't imagine what the future might bring.
>
> --
>
>   Julio Nobrega.
>
> One and One and One is Three
> "Brian S. Dunworth" <[EMAIL PROTECTED]> wrote in message
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> >
> > Are IE and Netscape both set the same as far as caching?
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Speed of loding PHP pages

2001-07-11 Thread Inércia Sensorial


  No. It also depends on the internal engine used by the browser to
'contruct' the elements. On Windows plataforms, Netscape are slower to
render cached pages. But IE has an advantage, it is built around some native
windows functionalities, one of the reasons it is faster. I don't know for
other plataforms tought.

  Anyway, Opera is the fastest :-) Also the new engine from mozilla (not NS
6.0), is fast, but since it is not to be considerable a final release, even
most recent ones, I can't imagine what the future might bring.

--

  Julio Nobrega.

One and One and One is Three
"Brian S. Dunworth" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
>
> Are IE and Netscape both set the same as far as caching?



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Speed of loding PHP pages

2001-07-11 Thread Brian S. Dunworth


Are IE and Netscape both set the same as far as caching?

 -
   Brian S. Dunworth
   Sr. Software Development Engineer
   Oracle Database Administrator
   The Printing House, Ltd.

   (850) 875-1500  x225
   <[EMAIL PROTECTED]>
 -


-Original Message-
From:   Don [SMTP:[EMAIL PROTECTED]]
Sent:   Wednesday, July 11, 2001 12:48 PM
To: php list
Subject:[PHP] Speed of loding PHP pages

Hi,

Has anyone tries any test loading PHP pages into IE 5.x and Netscape
4.7x?

As an experiment, I have a page that issues a phpinfo().  WIth I.E. 5.5,
it takes about 3 seconds.  With Netscape 4.77, it takes almost 20
seconds.

Thanks,
Don


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Speed of loding PHP pages

2001-07-11 Thread Alexander Wagner

Don wrote:
> Has anyone tries any test loading PHP pages into IE 5.x and Netscape
> 4.7x?

This is in no way related to PHP.
It's just the old Netscape taking lots of time for +rendering large 
pages, especially with nested tables.

regards
Wagner

-- 
Madness takes its toll. Please have exact change.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Speed of loding PHP pages

2001-07-11 Thread infoz

Netscape is notoriously slug-like when it comes to loading large tables
(i.e. the output of phpinfo()).

- Tim

> As an experiment, I have a page that issues a phpinfo().  WIth I.E. 5.5,
> it takes about 3 seconds.  With Netscape 4.77, it takes almost 20
> seconds.



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Speed of MySQL connections - Socket vs. Non-Socket

2001-04-17 Thread Alexander Skwar

So sprach Don Read am Tue, Apr 17, 2001 at 06:06:53PM -0500:
> I have with 3.0.18 installed (to match customers), 'localhost' will use the
> /tmp/mysql.sock. This may have changed under 4.x.

Oh, yes, you are right!  Thanks a lot - would have thought that I'd need to
say 'localhost:/tmp/mysql.sock', but, guess I'm wrong :)

Thanks,
Alexander Skwar
-- 
How to quote:   http://learn.to/quote (german) http://quote.6x.to (english)
Homepage:   http://www.digitalprojects.com   |   http://www.iso-top.de
   iso-top.de - Die günstige Art an Linux Distributionen zu kommen
Uptime: 1 day 1 hour 25 minutes

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Speed of MySQL connections - Socket vs. Non-Socket

2001-04-17 Thread Alexander Skwar

So sprach Don Read am Tue, Apr 17, 2001 at 05:13:14PM -0500:
> define('DBHOST', 'localhost');
> // define('DBHOST', 'myhost.domain.com');
> 
> define('QRY', 'select * from foo');   
> 
>   $db=mysql_connect(DBHOST, DBUSER, DBPASS);
>   if ( $db ) 
>  testquery(QRY);
>   
> 
> ?>
> 
> set the define(s) to something sensible for your setup.
> 
> 'myhost.domain.com' would be your network hostname for the box, either in
> /etc/hosts or from your DNS server.
> 
> test the numbers using the 'localhost' (the AF_UNIX socket).
> comment/uncoment the 'myhost' line & re-test (AF_INET connect).

the first define, defines a connect using a AF_UNIX socket?  Are you sure? 
According to the manual, I'd have thought, that I'd need to do:

define('DBHOST', 'localhost:/tmp/mysql.sock' );

Alexander Skwar
-- 
How to quote:   http://learn.to/quote (german) http://quote.6x.to (english)
Homepage:   http://www.digitalprojects.com   |   http://www.iso-top.de
   iso-top.de - Die günstige Art an Linux Distributionen zu kommen
Uptime: 1 day 0 hours 33 minutes

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Speed of MySQL connections - Socket vs. Non-Socket

2001-04-17 Thread Alexander Skwar

So sprach Christian Reiniger am Tue, Apr 17, 2001 at 02:01:48PM +0200:
> run "ab" (comes with apache) on two scripts, one using method A 
> repeatedly, the other using method B repeatedly

Thanks, will do.

Alexander Skwar
-- 
How to quote:   http://learn.to/quote (german) http://quote.6x.to (english)
Homepage:   http://www.digitalprojects.com   |   http://www.iso-top.de
   iso-top.de - Die günstige Art an Linux Distributionen zu kommen
Uptime: 23 hours 6 minutes

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Speed of MySQL connections - Socket vs. Non-Socket

2001-04-17 Thread Alexander Skwar

So sprach Don Read am Tue, Apr 17, 2001 at 02:14:41PM -0500:
> Yes, from my memory of the mysql list; AF_INET is 7% slower then AF_UNIX in
> data thru-put. Plus you have to add in the connection build & tear-down time. 

That's exactly what I'd expect.  Hmm, so I take it, I should also ask on the
MySQL list?

And, do you have any suggestions about how to benchmark this?

Thanks a lot,
Alexander Skwar
-- 
How to quote:   http://learn.to/quote (german) http://quote.6x.to (english)
Homepage:   http://www.digitalprojects.com   |   http://www.iso-top.de
   iso-top.de - Die günstige Art an Linux Distributionen zu kommen
Uptime: 22 hours 21 minutes

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Speed of MySQL connections - Socket vs. Non-Socket

2001-04-17 Thread Don Read


On 16-Apr-01 Alexander Skwar wrote:
> Hello!
> 
> In a mysql_connect() it is possible to specify a path to the socket which
> should be used for communicating with MySQL.
> 
> Now, when I connect thru a socket, is the datatransfer between PHP and MySQL
> faster than when I connect via a (loop-)network?  I would assume so, because
> with a socket, there's not the network layer in the way which has to be
> taken care of.
> 
> Is this correct?
> 

Yes, from my memory of the mysql list; AF_INET is 7% slower then AF_UNIX in
data thru-put. Plus you have to add in the connection build & tear-down time. 

Regards,
-- 
Don Read   [EMAIL PROTECTED]
-- It's always darkest before the dawn. So if you are going to 
   steal the neighbor's newspaper, that's the time to do it.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Speed of MySQL connections - Socket vs. Non-Socket

2001-04-17 Thread Christian Reiniger

On Tuesday 17 April 2001 02:10, you wrote:
> So sprach Brian Clark am Mon, Apr 16, 2001 at 08:01:04PM -0400:
> > Ahhh, yes, I see that was stupid. Sorry, Alexander. :)
>
> Ah, thanks Joe for clearing up this confusion :))
>
> Now that this is sorted out:  What might be the best way to do some
> benchmarking wrt. this?  (Links are fine)

run "ab" (comes with apache) on two scripts, one using method A 
repeatedly, the other using method B repeatedly

-- 
Christian Reiniger
LGDC Webmaster (http://sunsite.dk/lgdc/)

"Never doubt that a small group of thoughtful, committed people can
change the world...
Indeed, it's the only thing that ever has."

- Margaret Mead

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Speed of MySQL connections - Socket vs. Non-Socket

2001-04-16 Thread Alexander Skwar

So sprach Brian Clark am Mon, Apr 16, 2001 at 08:01:04PM -0400:
> Ahhh, yes, I see that was stupid. Sorry, Alexander. :)

Ah, thanks Joe for clearing up this confusion :))

Now that this is sorted out:  What might be the best way to do some
benchmarking wrt. this?  (Links are fine)

Alexander Skwar
-- 
How to quote:   http://learn.to/quote (german) http://quote.6x.to (english)
Homepage:   http://www.digitalprojects.com   |   http://www.iso-top.de
   iso-top.de - Die günstige Art an Linux Distributionen zu kommen
Uptime: 2 hours 1 minute

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Speed of MySQL connections - Socket vs. Non-Socket

2001-04-16 Thread Alexander Skwar

So sprach Brian Clark am Mon, Apr 16, 2001 at 07:37:54PM -0400:
> > In a mysql_connect() it is possible to specify a path to the socket
> > which should be used for communicating with MySQL.
> 
> Yes. [string hostname [:port] [:/path/to/socket]

And again: There's no question in the sentence above, is there?  If I had
questions about this, I'd have said something like:

| In a mysql_connect(), is it possible to specify a path to the socket
| which should be used for communicating with MySQL?

> > Now, when I connect thru a socket, is the datatransfer between PHP
> > and MySQL faster than when I connect via a (loop-)network?
> 
> No idea.

Yes, I got that :))

Alexander Skwar
-- 
How to quote:   http://learn.to/quote (german) http://quote.6x.to (english)
Homepage:   http://www.digitalprojects.com   |   http://www.iso-top.de
   iso-top.de - Die günstige Art an Linux Distributionen zu kommen
Uptime: 1 hour 59 minutes

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Speed of MySQL connections - Socket vs. Non-Socket

2001-04-16 Thread Alexander Skwar

So sprach [EMAIL PROTECTED] am Tue, Apr 17, 2001 at 01:55:01AM +0200:
> I haven't to read the manual again. This is very well documented in the
> manual. If I remember correctly, I have put this lines into the PHP
> manual. 

Pardon me, but where is it very well documented what I asked about? 
Certainly not in the manual I always use:
http://php.net/manual/en/function.mysql-connect.php 

Just to clarify: I did not ask if it is possible to do so.  I've read this
myself in the very good manual and would certainly not ask such a question
here.

But maybe I'm wrong:  Where is the answer to my question "well documented"?

Alexander Skwar
-- 
How to quote:   http://learn.to/quote (german) http://quote.6x.to (english)
Homepage:   http://www.digitalprojects.com   |   http://www.iso-top.de
   iso-top.de - Die günstige Art an Linux Distributionen zu kommen
Uptime: 1 hour 55 minutes

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Speed of MySQL connections - Socket vs. Non-Socket

2001-04-16 Thread Brian Clark

Hi Joe,

@ 8:04:08 PM on 4/16/2001, Joe Sheble (Wizaerd) wrote:

...
>> > In a mysql_connect() it is possible to specify a path to the socket
  ^^

>> > which should be used for communicating with MySQL.
>>
>> Yes. [string hostname [:port] [:/path/to/socket]

> It's not a question. It is a statement prefecaing the real question,
> which was is connecting directly to a socket faster.

Ahhh, yes, I see that was stupid. Sorry, Alexander. :)

I guess it's time to go back into hibernation.

-Brian
--
 PGP is spoken here: 0xE4D0C7C8
 Please, DO NOT carbon copy me on list replies.



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Speed of MySQL connections - Socket vs. Non-Socket

2001-04-16 Thread Joe Sheble \(Wizaerd\)

> > Please read again what I wrote
>
> OK.
>
> > In a mysql_connect() it is possible to specify a path to the socket
> > which should be used for communicating with MySQL.
>
> Yes. [string hostname [:port] [:/path/to/socket]

It's not a question.  It is a statement prefecaing the real question, which
was is connecting directly to a socket faster.


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Speed of MySQL connections - Socket vs. Non-Socket

2001-04-16 Thread eschmid+sic

On Tue, Apr 17, 2001 at 01:29:45AM +0200, Alexander Skwar wrote:
> So sprach Brian Clark am Mon, Apr 16, 2001 at 07:17:43PM -0400:
> > > In a mysql_connect() it is possible to specify a path to the socket
> > > which should be used for communicating with MySQL.
> > 
> > Yes, it's in the documentation.
> 
> Please read again what I wrote

I haven't to read the manual again. This is very well documented in the
manual. If I remember correctly, I have put this lines into the PHP
manual. 

-Egon

-- 
LinuxTag, Stuttgart, Germany: July 5-8 2001: http://www.linuxtag.de/
All known books about PHP and related books: http://php.net/books.php 
Concert Band of the University of Hohenheim: http://www.concert-band.de/
First and second bestselling book in German: http://www.php-buch.de/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Speed of MySQL connections - Socket vs. Non-Socket

2001-04-16 Thread Brian Clark

Hi Alexander,

@ 7:29:45 PM on 4/16/2001, Alexander Skwar wrote:

...
> Please read again what I wrote

OK.

> In a mysql_connect() it is possible to specify a path to the socket
> which should be used for communicating with MySQL.

Yes. [string hostname [:port] [:/path/to/socket]

> Now, when I connect thru a socket, is the datatransfer between PHP
> and MySQL faster than when I connect via a (loop-)network?

No idea.

-Brian
--
 PGP is spoken here: 0xE4D0C7C8
 Please, DO NOT carbon copy me on list replies.



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Speed of MySQL connections - Socket vs. Non-Socket

2001-04-16 Thread Alexander Skwar

So sprach Brian Clark am Mon, Apr 16, 2001 at 07:17:43PM -0400:
> > In a mysql_connect() it is possible to specify a path to the socket
> > which should be used for communicating with MySQL.
> 
> Yes, it's in the documentation.

Please read again what I wrote

Alexander Skwar
-- 
How to quote:   http://learn.to/quote (german) http://quote.6x.to (english)
Homepage:   http://www.digitalprojects.com   |   http://www.iso-top.de
   iso-top.de - Die günstige Art an Linux Distributionen zu kommen
Uptime: 1 hour 21 minutes

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Speed of MySQL connections - Socket vs. Non-Socket

2001-04-16 Thread Brian Clark

Hi Alexander,

@ 6:55:58 PM on 4/16/2001, Alexander Skwar wrote:

...
> In a mysql_connect() it is possible to specify a path to the socket
> which should be used for communicating with MySQL.

Yes, it's in the documentation.

int mysql_connect ([string hostname [:port] [:/path/to/socket]
   [, string username [, string password]]])

http://www.php.net/manual/en/function.mysql-connect.php

> Now, when I connect thru a socket, is the datatransfer between PHP
> and MySQL faster than when I connect via a (loop-)network? I would
> assume so, because with a socket, there's not the network layer in
> the way which has to be taken care of.

> Is this correct?

No earthly idea.

-Brian
--
 PGP is spoken here: 0xE4D0C7C8
 Please, DO NOT carbon copy me on list replies.



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]