1. Question About Web Site Speed

Using the Apache server, how would the speed of a web site served up by
Euphoria compare with one served up by PHP?

Considerations:

+ PHP is "built-in" to the Apache server (or "better" integrated than what
  is available for Euphoria); how significant is this an advantage?
+ Euphoria is faster than PHP in performance; true to what extent?
+ How many users could each accommodate at a time? in a minute?
+ ...?

I'm asking because I'm considering using Euphoria for a commercial site. If
not Euphoria, it will probably be PHP.

-=ck
"Programming in a state of EUPHORIA."
http://www.cklester.com/euphoria/

new topic     » topic index » view message » categorize

2. Re: Question About Web Site Speed

> Using the Apache server, how would the speed of a web site served up by
> Euphoria compare with one served up by PHP?
>
> I'm asking because I'm considering using Euphoria for a commercial site. =
If
> not Euphoria, it will probably be PHP.

To tell you the honest truth... I'd say go with PHP. Euphoria *works*
as a CGI language, but it was never designed for it. PHP is very nice,
and is designed specifically as a CGI language. You have integrated,
well... everything! Database access, FTP access, form handling, file
uploads, even the elusive 'foreach' loop.

I like Euphoria for GUI apps and command-line tools. I like PHP for
CGI and webpages.

~Greg

P.S. I am working on rewriting database.e into a PHP file so I can
read and write EDS files. That way I can write a Euphoria app to alter
my databases, but serve them out via PHP. If you're interested, I can
send you a copy of it when I'm done. It's not a priority right now,
but I could probably knock it out in one or two nights. I may also
upload it to the Archive.

new topic     » goto parent     » topic index » view message » categorize

3. Re: Question About Web Site Speed

Greg Haberek wrote:
> 
> I like Euphoria for GUI apps and command-line tools. I like PHP for
> CGI and webpages.

Reasonable and informed advice... Thanks, Greg. :)

> I may also upload it to the Archive.

I'll check it out then! :)

-=ck
"Programming in a state of EUPHORIA."
http://www.cklester.com/euphoria/

new topic     » goto parent     » topic index » view message » categorize

4. Re: Question About Web Site Speed

Greg Haberek wrote:
> C.K. Lester wrote:
> > Using the Apache server, how would the speed of a web site served up by
> > Euphoria compare with one served up by PHP?
> ...
> To tell you the honest truth... I'd say go with PHP. Euphoria *works*
> as a CGI language, but it was never designed for it. PHP is very nice,
> and is designed specifically as a CGI language. You have integrated,
> well... everything! Database access, FTP access, form handling, file
> uploads, even the elusive 'foreach' loop.

I haven't tried any benchmarks, but on ListFilter, 
php is a bloated 10Mb executable while exu is a lean 150K.
That must make a difference in start-up time.
Maybe that's why they have to integrate php with Apache.
Maybe they are dedicating a chunk of memory to it.

php is a typical interpreter that's much slower than Euphoria.
It couldn't handle the EUforum search for example, without
people screaming.

With Euphoria you can translate to C and completely 
eliminate the interpreter start-up time, and the source code
parsing time. Both are important if you want to execute hundreds
of CGI queries per second. With binding you can at least eliminate
the parse time. Some CGI programs are quite large but only execute 
a small number of statements each time they are run, so the parsing
time could easily exceed the CGI execution time.

Regards,
   Rob Craig
   Rapid Deployment Software
   http://www.RapidEuphoria.com

new topic     » goto parent     » topic index » view message » categorize

5. Re: Question About Web Site Speed

Robert Craig wrote:

> Both are important if you want to execute hundreds
> of CGI queries per second.

That's my main concern, is how well can Apache+Euphoria handle traffic
compared to the Apache+PHP combo. If Apache is the determinant, then
PHP vs. Euphoria doesn't matter... except Euphoria will kick PHPs buttoxen
in the time trials and thereby win. If Euphoria can't handle more than one
connection at a time but PHP can, that might be the criteria. I hope somebody
knows. :)

-=ck
"Programming in a state of EUPHORIA."
http://www.cklester.com/euphoria/

new topic     » goto parent     » topic index » view message » categorize

6. Re: Question About Web Site Speed

Robert Craig wrote:
> 
> php is a typical interpreter that's much slower than Euphoria.
> It couldn't handle the EUforum search for example, without
> people screaming.

With an index, it would probably work fine. Or see here:

http://www.interspire.com/fastfind/demo.php

-=ck
"Programming in a state of EUPHORIA."
http://www.cklester.com/euphoria/

new topic     » goto parent     » topic index » view message » categorize

7. Re: Question About Web Site Speed

cklester wrote:
> That's my main concern, is how well can Apache+Euphoria handle traffic
> compared to the Apache+PHP combo. If Apache is the determinant, then
> PHP vs. Euphoria doesn't matter... except Euphoria will kick PHPs buttoxen
> in the time trials and thereby win. If Euphoria can't handle more than one
> connection at a time but PHP can, that might be the criteria. I hope somebody
> knows. :)

You can have multiple Euphoria CGI programs 
executing at the same time, handling requests from
multiple users. They run as separate processes under Linux 
or Windows or FreeBSD. I can see it happen in my debug logs 
with the EUforum search. One person will start a search,
and before it finishes another person might start a different search,
so you've got two searches running at the same time.
The lack of threads just means you can't easily have 
*one program* handling multiple requests at the same time
by itself.

Regards,
   Rob Craig
   Rapid Deployment Software
   http://www.RapidEuphoria.com

new topic     » goto parent     » topic index » view message » categorize

8. Re: Question About Web Site Speed

cklester wrote:
> Robert Craig wrote:
> > 
> > php is a typical interpreter that's much slower than Euphoria.
> > It couldn't handle the EUforum search for example, without
> > people screaming.
> 
> With an index, it would probably work fine. Or see here:

I do a bit of indexing. For example if you specify the "posted by"
field, I can give you your results almost instantly.

However, there are no limits on the strings you can search for and
quite often it's necessary to actually read every line of
all 70,000 messages (over 100MB). I suspect no one
would try that with pure PHP.
 
> <a
> href="http://www.interspire.com/fastfind/demo.php">http://www.interspire.com/fastfind/demo.php</a>

It looks like you have to run a separate program periodically
to re-index everything. The EUforum search always includes 
the very latest messages. Also, I don't know if they use PHP code
down at the lowest level. CPU-intensive programs will be faster 
with Euphoria. Search is just one example.

Regards,
   Rob Craig
   Rapid Deployment Software
   http://www.RapidEuphoria.com

new topic     » goto parent     » topic index » view message » categorize

9. Re: Question About Web Site Speed

cklester wrote:
> 
> Using the Apache server, how would the speed of a web site served up by
> Euphoria compare with one served up by PHP?
> 
> Considerations:
> 
> + PHP is "built-in" to the Apache server (or "better" integrated than what
>   is available for Euphoria); how significant is this an advantage?
> + Euphoria is faster than PHP in performance; true to what extent?
> + How many users could each accommodate at a time? in a minute?
> + ...?
> 
> I'm asking because I'm considering using Euphoria for a commercial site. If
> not Euphoria, it will probably be PHP.
> 
> -=ck
> "Programming in a state of EUPHORIA."
> <a
> href="http://www.cklester.com/euphoria/">http://www.cklester.com/euphoria/</a>

My friend and I are actually using Euphoria for a (hopefully) commercial
project. We've found that there's not that much difference unless you're
embedding the PHP in a webpage then there is an advantage. Other than that we
haven't seen that much difference however we're not doing any strenuous
computation nor have we fully measured PHP verus Euphoria (we're just going by
what it seemed like). However, we have measured that CGI with Euphoria is
typically faster than CGI in Perl for most tasks and if you translate and compile
it it's even better.

new topic     » goto parent     » topic index » view message » categorize

10. Re: Question About Web Site Speed

On 13 Jul 2005, at 15:40, Robert Craig wrote:

> 
> 
> posted by: Robert Craig <rds at RapidEuphoria.com>
> 
> cklester wrote:
> > Robert Craig wrote:
> > > 
> > > php is a typical interpreter that's much slower than Euphoria.
> > > It couldn't handle the EUforum search for example, without
> > > people screaming.
> > 
> > With an index, it would probably work fine. Or see here:
> 
> I do a bit of indexing. For example if you specify the "posted by"
> field, I can give you your results almost instantly.
> 
> However, there are no limits on the strings you can search for and
> quite often it's necessary to actually read every line of
> all 70,000 messages (over 100MB). I suspect no one
> would try that with pure PHP.

Looks like some people are wearing blinders 24-7. I indexed a couple of db, 
one of 3.3 gigabytes (626,769 files), and one of 10.1 gigabytes (1,005,239 
files).

I add some 500+ new files per day with one app (averaging about 750K bytes 
per day), and 5,800 files with another app (averaging 15 megabytes per day). 
And there's other apps running too, but are comparatively slower adding 
things. The files are munged before saving, and duplicates are not added. No 
problem indexing more than the "posted by" field here, i index ALL the words 
by filename and count and frequency/file and global frequency. And the neat 
thing is, a search is instant, and i don't need to load even ONE megabyte 
into memory.

Perhaps the problem with using Eu as a web server database isn't with that 
per se, it's more with loading a 100megabyte db in Eu (making it 400megs 
for lack of a string type) each time someone does a search can quickly run 
out of memory on any reasonable (/ly priced) server shell. And doing gets() 
on a brute force search of a 100 meg file (RobC said his program does that!?) 
takes too long. But what do i know, i play with a 14 gigabyte database and 
want "goto" and string types added to Eu.

Kat

new topic     » goto parent     » topic index » view message » categorize

11. Re: Question About Web Site Speed

Kat wrote:
> I add some 500+ new files per day with one app (averaging about 750K bytes 
> per day), and 5,800 files with another app (averaging 15 megabytes per day). 
> And there's other apps running too, but are comparatively slower adding 
> things. The files are munged before saving, and duplicates are not added. No 
> problem indexing more than the "posted by" field here, i index ALL the words 
> by filename and count and frequency/file and global frequency. And the neat 
> thing is, a search is instant, and i don't need to load even ONE megabyte 
> into memory.
> 
> Perhaps the problem with using Eu as a web server database isn't with that 
> per se, it's more with loading a 100megabyte db in Eu (making it 400megs 
> for lack of a string type) each time someone does a search can quickly run 
> out of memory on any reasonable (/ly priced) server shell. And doing gets() 
> on a brute force search of a 100 meg file (RobC said his program does that!?) 
> takes too long. But what do i know, i play with a 14 gigabyte database and 
> want "goto" and string types added to Eu.

For the record: 

I don't use a database. (EDS didn't exist when I started
writing this thing.)

I use gets() to read in each line, but I only keep one line 
at a time in memory. There's no need to load the whole 
100Mb into memory. I don't even store the "hit" messages in memory.

I do have an index of the 1000 most-recently searched-for words.
If it's one of those words, I don't have to read any messages
(except new messages that came in after that word was last searched).

I also keep track of all 2-letter combinations in each message.
If a message doesn't have all the 2-letter combinations needed
by a search word, I don't search that message. I use seek() to skip ahead.
e.g. if searching for EUPHORIA, a message must contain somewhere:
EU UP PH HO OR RI and IA, or I won't look at it.

The worst case (and this happens fairly often)
is when someone searches for words that aren't in
the 1000-word index, and don't have any unusual letter combinations.
e.g. if you search for a number (e.g. 123456) that isn't in the 
1000-word cache, I will have to read every line of every message.
These days that only takes a few seconds.

Regards,
   Rob Craig
   Rapid Deployment Software
   http://www.RapidEuphoria.com

new topic     » goto parent     » topic index » view message » categorize

12. Re: Question About Web Site Speed

Robert Craig wrote:
> cklester wrote:
> > That's my main concern, is how well can Apache+Euphoria handle traffic
> > compared to the Apache+PHP combo.
> 
> You can have multiple Euphoria CGI programs 
> executing at the same time, handling requests from
> multiple users. They run as separate processes under Linux 
> or Windows or FreeBSD. I can see it happen in my debug logs 
> with the EUforum search. One person will start a search,
> and before it finishes another person might start a different search,
> so you've got two searches running at the same time.
> The lack of threads just means you can't easily have 
> *one program* handling multiple requests at the same time
> by itself.

Aaahhhh... great news! :)

-=ck
"Programming in a state of EUPHORIA."
http://www.cklester.com/euphoria/

new topic     » goto parent     » topic index » view message » categorize

13. Re: Question About Web Site Speed

On 7/14/05, Robert Craig <guest at rapideuphoria.com> wrote:
> cklester wrote:
> > Robert Craig wrote:
> > >
> > > php is a typical interpreter that's much slower than Euphoria.
> > > It couldn't handle the EUforum search for example, without
> > > people screaming.
> >
> > With an index, it would probably work fine. Or see here:
>
> I do a bit of indexing. For example if you specify the "posted by"
> field, I can give you your results almost instantly.
>
> However, there are no limits on the strings you can search for and
> quite often it's necessary to actually read every line of
> all 70,000 messages (over 100MB). I suspect no one
> would try that with pure PHP.

*snerk*

Of course not, they'd use any of the many database managers that are
easily accessible through php. mysql, postgresql, mssql, and more...

My opinion, such as it is, is that processing speed of the cgi scripts
is relatively unimportant for serving up most web pages. All of the
complex data sifting and logic can and should be passed off to
database applications that are built for this sort of thing. There are
a few exceptions to this rule - scripts that might have to dynamically
calculate some complex mathematical formulae that can't be implemented
in mysql - ... but 99.9% of tasks will be fine.

So, the important thing becomes ease of development, and ease of security.=

Euphoria and PHP are both quite flexible languages.. no points lost by
either side there.
PHP has a raft of available functions as part of its standard
libraries to do just about anything, with standardised conventions,
and lots of documentation.
Euphoria has ... well ...=20

So I too would say php is better for serving web pages... unless you
really, REALLY like implementing everything from scratch.

--
MrTrick
----------

new topic     » goto parent     » topic index » view message » categorize

14. Re: Question About Web Site Speed

Patrick Barnes wrote:
> So I too would say php is better for serving web pages... 

 Shootout - sieve
 Interpreters, sorted by seconds taken:
 (EtoC added for comparison)
 ---------------------------------------
 Euphoria  0.13  - EtoC Translator / Watcom
 Euphoria  0.47  - Interpreted with exw.exe
 pliant    0.68
 gforth    0.75
 parrot    2.98
 ocamlb    3.21
 poplisp   3.34
 eu in eu  7.15  - PD source Euphoria translated/compiled to eu.exe
 erlang    7.16
 lua       8.70
 pike     10.36
 python   14.33
 icon     15.12
 perl     16.36
 elastic  16.88
 guile    18.64
 cygperl  19.22
 ruby     27.59
 mawk     28.00
 vbscript 32.02
 php      67.32   <---- !!!
 jscript  77.43
 tcl      83.10
 gawk    158.49
 rexx    166.85

So, on sieve at least, Euphoria (interpreted) is 
67.32/.47 = 143x faster than php

while E2C Euphoria is: 
67.32/.13 = 517x faster.

If you don't mind giving up that much speed,
by all means consider using php for CGI.

Regards,
   Rob Craig
   Rapid Deployment Software
   http://www.RapidEuphoria.com

new topic     » goto parent     » topic index » view message » categorize

15. Re: Question About Web Site Speed

Robert Craig wrote:
> 
> Patrick Barnes wrote:
> > So I too would say php is better for serving web pages... 
> 
>  Shootout - sieve
>  Interpreters, sorted by seconds taken:
>  (EtoC added for comparison)
>  ---------------------------------------
>  Euphoria  0.13  - EtoC Translator / Watcom
>  Euphoria  0.47  - Interpreted with exw.exe
>  pliant    0.68
>  gforth    0.75
>  parrot    2.98
>  ocamlb    3.21
>  poplisp   3.34
>  eu in eu  7.15  - PD source Euphoria translated/compiled to eu.exe
>  erlang    7.16
>  lua       8.70
>  pike     10.36
>  python   14.33
>  icon     15.12
>  perl     16.36
>  elastic  16.88
>  guile    18.64
>  cygperl  19.22
>  ruby     27.59
>  mawk     28.00
>  vbscript 32.02
>  php      67.32   <---- !!!
>  jscript  77.43
>  tcl      83.10
>  gawk    158.49
>  rexx    166.85
> 
> So, on sieve at least, Euphoria (interpreted) is 
> 67.32/.47 = 143x faster than php
> 
> while E2C Euphoria is: 
> 67.32/.13 = 517x faster.
> 
> If you don't mind giving up that much speed,
> by all means consider using php for CGI.
> 
> Regards,
>    Rob Craig
>    Rapid Deployment Software
>    <a href="http://www.RapidEuphoria.com">http://www.RapidEuphoria.com</a>
> 

In all fairness, Patrick's point was that there aren't a lot of CGIs doing
sieves, now are there?  He was trying to say that doing large indexing and
lookups, like you do on the EUforum search, is generally done with an external
database and therefore PHP speed vs. Euphoria speed isn't as important.  So then
it all boils down to programmer time to either find and use certain functions in
libraries or write them from scratch.

At least I hope I'm not putting words in his mouth. That is what I understood
from his post.

=====================================
Too many freaks, not enough circuses.

j.

new topic     » goto parent     » topic index » view message » categorize

16. Re: Question About Web Site Speed

Robert Craig wrote:
> 
>  Shootout - sieve
>  Interpreters, sorted by seconds taken:
>  (EtoC added for comparison)
>  ---------------------------------------
>  Euphoria  0.13  - EtoC Translator / Watcom
>  Euphoria  0.47  - Interpreted with exw.exe
>  pliant    0.68
>  gforth    0.75
>  parrot    2.98
>  ocamlb    3.21
>  poplisp   3.34
>  eu in eu  7.15  - PD source Euphoria translated/compiled to eu.exe
>  erlang    7.16
>  lua       8.70
>  pike     10.36
>  python   14.33
>  icon     15.12
>  perl     16.36
>  elastic  16.88
>  guile    18.64
>  cygperl  19.22
>  ruby     27.59
>  mawk     28.00
>  vbscript 32.02
>  php      67.32   <---- !!!
>  jscript  77.43
>  tcl      83.10
>  gawk    158.49
>  rexx    166.85

All this says to me is, "pliant is teh roXorz!!!!!"

heheh. Just kiddin'. :)

There are no doubt huge sites using PHP for service, right? They seem to do
just fine, though maybe they aren't "pure" PHP (which means it uses components
that are not PHP). Would these same sites lose anything if they were to be
served with Euphoria (namely, ease-of-management)? Would they gain something
(other than speed) if served by Euphoria?

-=ck
"Programming in a state of EUPHORIA."
http://www.cklester.com/euphoria/

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu