Discussion:
Phux - High Performance PHP Router
Lin Yo-An
2014-01-05 22:53:41 UTC
Permalink
Hi folks,


Glad to announce that the first version of Phux PHP Router is released.

https://github.com/c9s/phux


Phux is basically a rewrite of PHP Roller router.

Phux provides full functional C extension and pure PHP library with the
same interface, so the extension is optional to install.

but if you install phux extension, you may enjoy the performance of routing.



Route Dispatch Benchmark (Symfony/Routing and Phux pure PHP)

Loading Image...



Cheers,

Yo-An Lin
Sebastian Krebs
2014-01-05 23:54:45 UTC
Permalink
Post by Lin Yo-An
Hi folks,
Glad to announce that the first version of Phux PHP Router is released.
https://github.com/c9s/phux
Phux is basically a rewrite of PHP Roller router.
Phux provides full functional C extension and pure PHP library with the
same interface, so the extension is optional to install.
but if you install phux extension, you may enjoy the performance of routing.
Route Dispatch Benchmark (Symfony/Routing and Phux pure PHP)
https://raw.github.com/c9s/Phux/master/benchmarks/reqs.png
Hi,

Not a comment about Phux directly, but I think I have to point this out
(sadly: once more): When you use Apache Benchmark to benchmark the
performance of an PHP-component, you in fact benchmark your system... [1]
Another flaw is, that the whole benchmark setup is missing, which makes it
slightly suspicious and unreliable. Two things, that spontanous came into
my mind

- Because you use ab to benchmark it is unlikely, that the S2-setup
contains the routing-component only. This means, that in this benchmark you
measure more than just the routing. OK, the README states, that "Testing
with route dispatch only. (no controller)", but information on how do the
benchmarks setup the routing is missing.
- Like so many other benchmarks improvments, that every S2-application
relies in production on, are probably missing. Do you compile the
routing-table from a config into PHP? Do you use APC? While it sounds
totally fair to compare two bare setups, it isn't. It probably ignores
customizations, that are possible in one, but not the other and that
affects the outcome. Most obvious example is what I mentioned: Parsing a
YAML, generating the routing table and routing is something very different
than reading the routing-table from an APC-cached PHP-file and routing.

I don't say Phux is bad or something, but my advice is to rework the
benchmark and publish the setup. Beside this I am more interested in
benchmarks of the C-extension (especially against the native-PHP solution)
:)

Regards,
Sebastian


[1] The worst thing about this, is that you not only benchmark the target
system, but the benchmark also relies heavily on the local one. Even worse
than worse: Running both on the same machine let them affect each other in
a non-predictable way. You get numbers, but you can never tell, what they
mean.
Post by Lin Yo-An
Cheers,
Yo-An Lin
--
github.com/KingCrunch
Yo-An Lin
2014-01-06 07:17:51 UTC
Permalink
Here is the benchmark details, you can find the benchmark code below:

https://github.com/c9s/router-benchmark

on intel xeon 16 cores machine:

symfony/routing only got 4873.17 #/sec while phux got 16777.12 #/sec

on intel core i5 machine:

symfony/routing only got around 200-300 #/sec while phux got around 1600-1800 #/sec



Also the pure php dispatch benchmark:

cat dispatch.txt
n=10000
Runing symfony/routing - . 6664.4093423989/s
Runing phux extension - . 16501.898328291/s

Rate Mem phux extension symfony/routing
phux extension 16K/s 5M -- -40%
symfony/routing 6K/s 786K 247% --


================================== Bar Chart ==================================

phux extension 16K/s | ████████████████████████████████████████████████████████████ |
symfony/routing 6K/s | ████████████████████████ |


============================== System Information ==============================

PHP Version: 5.5.6
Yeah I know, the benchmark is pretty rough. Because its a two day work. :p
The details will come up later.
[Sent from iPhone]
Post by Lin Yo-An
Hi folks,
Glad to announce that the first version of Phux PHP Router is released.
https://github.com/c9s/phux
Phux is basically a rewrite of PHP Roller router.
Phux provides full functional C extension and pure PHP library with the
same interface, so the extension is optional to install.
but if you install phux extension, you may enjoy the performance of routing.
Route Dispatch Benchmark (Symfony/Routing and Phux pure PHP)
https://raw.github.com/c9s/Phux/master/benchmarks/reqs.png
Hi,
Not a comment about Phux directly, but I think I have to point this out (sadly: once more): When you use Apache Benchmark to benchmark the performance of an PHP-component, you in fact benchmark your system... [1] Another flaw is, that the whole benchmark setup is missing, which makes it slightly suspicious and unreliable. Two things, that spontanous came into my mind
- Because you use ab to benchmark it is unlikely, that the S2-setup contains the routing-component only. This means, that in this benchmark you measure more than just the routing. OK, the README states, that "Testing with route dispatch only. (no controller)", but information on how do the benchmarks setup the routing is missing.
- Like so many other benchmarks improvments, that every S2-application relies in production on, are probably missing. Do you compile the routing-table from a config into PHP? Do you use APC? While it sounds totally fair to compare two bare setups, it isn't. It probably ignores customizations, that are possible in one, but not the other and that affects the outcome. Most obvious example is what I mentioned: Parsing a YAML, generating the routing table and routing is something very different than reading the routing-table from an APC-cached PHP-file and routing.
I don't say Phux is bad or something, but my advice is to rework the benchmark and publish the setup. Beside this I am more interested in benchmarks of the C-extension (especially against the native-PHP solution) :)
Regards,
Sebastian
[1] The worst thing about this, is that you not only benchmark the target system, but the benchmark also relies heavily on the local one. Even worse than worse: Running both on the same machine let them affect each other in a non-predictable way. You get numbers, but you can never tell, what they mean.
Cheers,
Yo-An Lin
--
github.com/KingCrunch
Sebastian Krebs
2014-01-07 09:44:01 UTC
Permalink
Post by Yo-An Lin
https://github.com/c9s/router-benchmark
Hi,

Well, you still use a full LAMP-stack and HTTP-benchmark-tool for
benchmarking. That was actually _the_ point, which makes this benchmark
useless for me...


Beside this: You should increase the routes you benchmark and introduce
more variation (pattern-matching, matching first/last route and so on),
because different implementations often differ in different situations.
Post by Yo-An Lin
symfony/routing only got 4873.17 #/sec while phux got 16777.12 #/sec
symfony/routing only got around 200-300 #/sec while phux got around 1600-1800 #/sec
cat dispatch.txt
n=10000
Runing symfony/routing - . 6664.4093423989/s
Runing phux extension - . 16501.898328291/s
Rate Mem phux extension symfony/routing
phux extension 16K/s 5M -- -40%
symfony/routing 6K/s 786K 247% --
================================== Bar Chart
==================================
phux extension 16K/s |
¢i¢i¢i¢i¢i¢i¢i¢i¢i¢i¢i¢i¢i¢i¢i¢i¢i¢i¢i¢i¢i¢i¢i¢i¢i¢i¢i¢i¢i¢i¢i¢i¢i¢i¢i¢i¢i¢i¢i¢i¢i¢i¢i¢i¢i¢i¢i¢i¢i¢i¢i¢i¢i¢i¢i¢i¢i¢i¢i¢i |
symfony/routing 6K/s | ¢i¢i¢i¢i¢i¢i¢i¢i¢i¢i¢i¢i¢i¢i¢i¢i¢i¢i¢i¢i¢i¢i¢i¢i
|
============================== System Information
==============================
PHP Version: 5.5.6
Yeah I know, the benchmark is pretty rough. Because its a two day work. :p
The details will come up later.
[Sent from iPhone]
Post by Lin Yo-An
Hi folks,
Glad to announce that the first version of Phux PHP Router is released.
https://github.com/c9s/phux
Phux is basically a rewrite of PHP Roller router.
Phux provides full functional C extension and pure PHP library with the
same interface, so the extension is optional to install.
but if you install phux extension, you may enjoy the performance of routing.
Route Dispatch Benchmark (Symfony/Routing and Phux pure PHP)
https://raw.github.com/c9s/Phux/master/benchmarks/reqs.png
Hi,
Not a comment about Phux directly, but I think I have to point this out
(sadly: once more): When you use Apache Benchmark to benchmark the
performance of an PHP-component, you in fact benchmark your system... [1]
Another flaw is, that the whole benchmark setup is missing, which makes it
slightly suspicious and unreliable. Two things, that spontanous came into
my mind
- Because you use ab to benchmark it is unlikely, that the S2-setup
contains the routing-component only. This means, that in this benchmark you
measure more than just the routing. OK, the README states, that "Testing
with route dispatch only. (no controller)", but information on how do the
benchmarks setup the routing is missing.
- Like so many other benchmarks improvments, that every S2-application
relies in production on, are probably missing. Do you compile the
routing-table from a config into PHP? Do you use APC? While it sounds
totally fair to compare two bare setups, it isn't. It probably ignores
customizations, that are possible in one, but not the other and that
affects the outcome. Most obvious example is what I mentioned: Parsing a
YAML, generating the routing table and routing is something very different
than reading the routing-table from an APC-cached PHP-file and routing.
I don't say Phux is bad or something, but my advice is to rework the
benchmark and publish the setup. Beside this I am more interested in
benchmarks of the C-extension (especially against the native-PHP solution)
:)
Regards,
Sebastian
[1] The worst thing about this, is that you not only benchmark the target
system, but the benchmark also relies heavily on the local one. Even worse
than worse: Running both on the same machine let them affect each other in
a non-predictable way. You get numbers, but you can never tell, what they
mean.
Post by Lin Yo-An
Cheers,
Yo-An Lin
--
github.com/KingCrunch
--
github.com/KingCrunch
Lin Yo-An
2014-01-07 10:31:24 UTC
Permalink
Sebastian Krebs ©ó 2014Š~1€ë7€é¬PŽÁ€GŒg¹D¡G
Post by Sebastian Krebs
Post by Yo-An Lin
https://github.com/c9s/router-benchmark
Hi,
Well, you still use a full LAMP-stack and HTTP-benchmark-tool for
benchmarking. That was actually _the_ point, which makes this benchmark
useless for me...
Beside this: You should increase the routes you benchmark and introduce
more variation (pattern-matching, matching first/last route and so on),
because different implementations often differ in different situations.
Check out code/dispatch.* . There are console benchmark script and result.

And u may add more test cases in it if u need
Post by Sebastian Krebs
symfony/routing only got 4873.17 #/sec while phux got 16777.12 #/sec
symfony/routing only got around 200-300 #/sec while phux got around 1600-1800 #/sec
cat dispatch.txt
n=10000
Runing symfony/routing - . 6664.4093423989/s
Runing phux extension - . 16501.898328291/s
Rate Mem phux extension symfony/routing
phux extension 16K/s 5M -- -40%
symfony/routing 6K/s 786K 247% --
================================== Bar Chart
==================================
phux extension 16K/s |
¢i¢i¢i¢i¢i¢i¢i¢i¢i¢i¢i¢i¢i¢i¢i¢i¢i¢i¢i¢i¢i¢i¢i¢i¢i¢i¢i¢i¢i¢i¢i¢i¢i¢i¢i¢i¢i¢i¢i¢i¢i¢i¢i¢i¢i¢i¢i¢i¢i¢i¢i¢i¢i¢i¢i¢i¢i¢i¢i¢i |
symfony/routing 6K/s | ¢i¢i¢i¢i¢i¢i¢i¢i¢i¢i¢i¢i¢i¢i¢i¢i¢i¢i¢i¢i¢i¢i¢i¢i
|
============================== System Information
==============================
PHP Version: 5.5.6
Yeah I know, the benchmark is pretty rough. Because its a two day work. :p
The details will come up later.
[Sent from iPhone]
Hi folks,
Glad to announce that the first version of Phux PHP Router is released.
https://github.com/c9s/phux
Phux is basically a rewrite of PHP Roller router.
Phux provides full functional C extension and pure PHP library with the
same interface, so the extension is optional to install.
but if you install phux extension, you may enjoy the performance of routing.
Route Dispatch Benchmark (Symfony/Routing and Phux pure PHP)
https://raw.github.com/c9s/Phux/master/benchmarks/reqs.png
Hi,
Not a comment about Phux directly, but I think I have to point this out
(sadly: once more): When you use Apache Benchmark to benchmark the
performance of an PHP-component, you in fact benchmark your system... [1]
Another flaw is, that the whole benchmark setup is missing, which makes it
slightly suspicious and unreliable. Two things, that spontanous came into
my mind
- Because you use ab to benchmark it is unlikely, that the S2-setup
contains the routing-component onl
--
github.com/KingCrunch
--
Best Regards,

Yo-An Lin
Yo-An lin
2014-01-07 12:01:10 UTC
Permalink
https://github.com/c9s/router-benchmark/blob/master/code/dispatch.txt Pure Dispatching Benchmark.

I use LAP environment to test because the result is more practical for production environment.

[Sent from iPhone]
Post by Yo-An Lin
https://github.com/c9s/router-benchmark
Hi,
Well, you still use a full LAMP-stack and HTTP-benchmark-tool for benchmarking. That was actually _the_ point, which makes this benchmark useless for me...
Beside this: You should increase the routes you benchmark and introduce more variation (pattern-matching, matching first/last route and so on), because different implementations often differ in different situations.
Post by Yo-An Lin
symfony/routing only got 4873.17 #/sec while phux got 16777.12 #/sec
symfony/routing only got around 200-300 #/sec while phux got around 1600-1800 #/sec
cat dispatch.txt
n=10000
Runing symfony/routing - . 6664.4093423989/s
Runing phux extension - . 16501.898328291/s
Rate Mem phux extension symfony/routing
phux extension 16K/s 5M -- -40%
symfony/routing 6K/s 786K 247% --
================================== Bar Chart ==================================
phux extension 16K/s | ¢i¢i¢i¢i¢i¢i¢i¢i¢i¢i¢i¢i¢i¢i¢i¢i¢i¢i¢i¢i¢i¢i¢i¢i¢i¢i¢i¢i¢i¢i¢i¢i¢i¢i¢i¢i¢i¢i¢i¢i¢i¢i¢i¢i¢i¢i¢i¢i¢i¢i¢i¢i¢i¢i¢i¢i¢i¢i¢i¢i |
symfony/routing 6K/s | ¢i¢i¢i¢i¢i¢i¢i¢i¢i¢i¢i¢i¢i¢i¢i¢i¢i¢i¢i¢i¢i¢i¢i¢i |
============================== System Information ==============================
PHP Version: 5.5.6
Yeah I know, the benchmark is pretty rough. Because its a two day work. :p
The details will come up later.
[Sent from iPhone]
Post by Lin Yo-An
Post by Lin Yo-An
Hi folks,
Glad to announce that the first version of Phux PHP Router is released.
https://github.com/c9s/phux
Phux is basically a rewrite of PHP Roller router.
Phux provides full functional C extension and pure PHP library with the
same interface, so the extension is optional to install.
but if you install phux extension, you may enjoy the performance of routing.
Route Dispatch Benchmark (Symfony/Routing and Phux pure PHP)
https://raw.github.com/c9s/Phux/master/benchmarks/reqs.png
Hi,
Not a comment about Phux directly, but I think I have to point this out (sadly: once more): When you use Apache Benchmark to benchmark the performance of an PHP-component, you in fact benchmark your system... [1] Another flaw is, that the whole benchmark setup is missing, which makes it slightly suspicious and unreliable. Two things, that spontanous came into my mind
- Because you use ab to benchmark it is unlikely, that the S2-setup contains the routing-component only. This means, that in this benchmark you measure more than just the routing. OK, the README states, that "Testing with route dispatch only. (no controller)", but information on how do the benchmarks setup the routing is missing.
- Like so many other benchmarks improvments, that every S2-application relies in production on, are probably missing. Do you compile the routing-table from a config into PHP? Do you use APC? While it sounds totally fair to compare two bare setups, it isn't. It probably ignores customizations, that are possible in one, but not the other and that affects the outcome. Most obvious example is what I mentioned: Parsing a YAML, generating the routing table and routing is something very different than reading the routing-table from an APC-cached PHP-file and routing.
I don't say Phux is bad or something, but my advice is to rework the benchmark and publish the setup. Beside this I am more interested in benchmarks of the C-extension (especially against the native-PHP solution) :)
Regards,
Sebastian
[1] The worst thing about this, is that you not only benchmark the target system, but the benchmark also relies heavily on the local one. Even worse than worse: Running both on the same machine let them affect each other in a non-predictable way. You get numbers, but you can never tell, what they mean.
Post by Lin Yo-An
Cheers,
Yo-An Lin
--
github.com/KingCrunch
--
github.com/KingCrunch
Yo-An Lin
2014-01-06 12:42:22 UTC
Permalink
Here is the benchmark details, you can find the benchmark code below:

https://github.com/c9s/router-benchmark

on intel xeon 16 cores machine:

symfony/routing only got 4873.17 #/sec while phux got 16777.12 #/sec

on intel core i5 machine:

symfony/routing only got around 200-300 #/sec while phux got around 1600-1800 #/sec



Also the pure php dispatch benchmark:

cat dispatch.txt
n=10000
Runing symfony/routing - . 6664.4093423989/s
Runing phux extension - . 16501.898328291/s

Rate Mem phux extension symfony/routing
phux extension 16K/s 5M -- -40%
symfony/routing 6K/s 786K 247% --


================================== Bar Chart ==================================

phux extension 16K/s | ████████████████████████████████████████████████████████████ |
symfony/routing 6K/s | ████████████████████████ |


============================== System Information ==============================

PHP Version: 5.5.6
Yeah I know, the benchmark is pretty rough. Because its a two day work. :p
The details will come up later.
[Sent from iPhone]
Post by Lin Yo-An
Hi folks,
Glad to announce that the first version of Phux PHP Router is released.
https://github.com/c9s/phux
Phux is basically a rewrite of PHP Roller router.
Phux provides full functional C extension and pure PHP library with the
same interface, so the extension is optional to install.
but if you install phux extension, you may enjoy the performance of routing.
Route Dispatch Benchmark (Symfony/Routing and Phux pure PHP)
https://raw.github.com/c9s/Phux/master/benchmarks/reqs.png
Hi,
Not a comment about Phux directly, but I think I have to point this out (sadly: once more): When you use Apache Benchmark to benchmark the performance of an PHP-component, you in fact benchmark your system... [1] Another flaw is, that the whole benchmark setup is missing, which makes it slightly suspicious and unreliable. Two things, that spontanous came into my mind
- Because you use ab to benchmark it is unlikely, that the S2-setup contains the routing-component only. This means, that in this benchmark you measure more than just the routing. OK, the README states, that "Testing with route dispatch only. (no controller)", but information on how do the benchmarks setup the routing is missing.
- Like so many other benchmarks improvments, that every S2-application relies in production on, are probably missing. Do you compile the routing-table from a config into PHP? Do you use APC? While it sounds totally fair to compare two bare setups, it isn't. It probably ignores customizations, that are possible in one, but not the other and that affects the outcome. Most obvious example is what I mentioned: Parsing a YAML, generating the routing table and routing is something very different than reading the routing-table from an APC-cached PHP-file and routing.
I don't say Phux is bad or something, but my advice is to rework the benchmark and publish the setup. Beside this I am more interested in benchmarks of the C-extension (especially against the native-PHP solution) :)
Regards,
Sebastian
[1] The worst thing about this, is that you not only benchmark the target system, but the benchmark also relies heavily on the local one. Even worse than worse: Running both on the same machine let them affect each other in a non-predictable way. You get numbers, but you can never tell, what they mean.
Cheers,
Yo-An Lin
--
github.com/KingCrunch
Robert Cummings
2014-01-06 15:46:21 UTC
Permalink
I don't know if you are aware or not, but the natural way to pronounce
"Phux" in English is the same as "Fucks" which may decrease the
likeability of Phux.

Cheers,
Rob.
Post by Lin Yo-An
Hi folks,
Glad to announce that the first version of Phux PHP Router is released.
https://github.com/c9s/phux
Phux is basically a rewrite of PHP Roller router.
Phux provides full functional C extension and pure PHP library with the
same interface, so the extension is optional to install.
but if you install phux extension, you may enjoy the performance of routing.
Route Dispatch Benchmark (Symfony/Routing and Phux pure PHP)
https://raw.github.com/c9s/Phux/master/benchmarks/reqs.png
Cheers,
Yo-An Lin
--
E-Mail Disclaimer: Information contained in this message and any
attached documents is considered confidential and legally protected.
This message is intended solely for the addressee(s). Disclosure,
copying, and distribution are prohibited unless authorized.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Yo-An lin
2014-01-06 15:56:26 UTC
Permalink
Hi Robber,

Thanks. I didnt notice that.

The original idea of the name was the combination of "php" and "mux". maybe "pux" or something will be a better choice.


[Sent from iPhone]
I don't know if you are aware or not, but the natural way to pronounce "Phux" in English is the same as "Fucks" which may decrease the likeability of Phux.
Cheers,
Rob.
Post by Lin Yo-An
Hi folks,
Glad to announce that the first version of Phux PHP Router is released.
https://github.com/c9s/phux
Phux is basically a rewrite of PHP Roller router.
Phux provides full functional C extension and pure PHP library with the
same interface, so the extension is optional to install.
but if you install phux extension, you may enjoy the performance of routing.
Route Dispatch Benchmark (Symfony/Routing and Phux pure PHP)
https://raw.github.com/c9s/Phux/master/benchmarks/reqs.png
Cheers,
Yo-An Lin
--
E-Mail Disclaimer: Information contained in this message and any
attached documents is considered confidential and legally protected.
This message is intended solely for the addressee(s). Disclosure,
copying, and distribution are prohibited unless authorized.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Sebastian Krebs
2014-01-06 15:59:34 UTC
Permalink
Post by Yo-An lin
Hi Robber,
Thanks. I didnt notice that.
The original idea of the name was the combination of "php" and "mux".
maybe "pux" or something will be a better choice.
Why "mux" at all? I know "mux" as shorthand of "multiplexing", which is
something different than routing.
Post by Yo-An lin
[Sent from iPhone]
Post by Robert Cummings
I don't know if you are aware or not, but the natural way to pronounce
"Phux" in English is the same as "Fucks" which may decrease the likeability
of Phux.
Post by Robert Cummings
Cheers,
Rob.
Post by Lin Yo-An
Hi folks,
Glad to announce that the first version of Phux PHP Router is released.
https://github.com/c9s/phux
Phux is basically a rewrite of PHP Roller router.
Phux provides full functional C extension and pure PHP library with the
same interface, so the extension is optional to install.
but if you install phux extension, you may enjoy the performance of
routing.
Post by Robert Cummings
Post by Lin Yo-An
Route Dispatch Benchmark (Symfony/Routing and Phux pure PHP)
https://raw.github.com/c9s/Phux/master/benchmarks/reqs.png
Cheers,
Yo-An Lin
--
E-Mail Disclaimer: Information contained in this message and any
attached documents is considered confidential and legally protected.
This message is intended solely for the addressee(s). Disclosure,
copying, and distribution are prohibited unless authorized.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--
github.com/KingCrunch
Lin Yo-an
2014-01-06 16:08:39 UTC
Permalink
Why "mux" at all? I know "mux" as shorthand of "multiplexing", which is something different than routing.
Mux was from Go’s net/http package, the mux struct basically does the same thing as router.
Lin Yo-an
2014-01-06 16:14:57 UTC
Permalink
Post by Lin Yo-an
Why "mux" at all? I know "mux" as shorthand of "multiplexing", which is something different than routing.
Mux was from Go’s net/http package, the mux struct basically does the same thing as router.
It stands for "HTTP request multiplexer.”

e.g. http://www.gorillatoolkit.org/pkg/mux
Tedd Sperling
2014-01-06 17:23:27 UTC
Permalink
Rob:

This reminds me of an oversea's client I had where they wanted to enter the American market with their Pet Shampoo. I told them they may want to pick a different domain name, but they insisted that they had properly investigated the market and had made their choice of "smellypet.com".

A year later, they contacted me and said they finally understood what I was talking about.

Cheers,

tedd

_______________
tedd sperling
I don't know if you are aware or not, but the natural way to pronounce "Phux" in English is the same as "Fucks" which may decrease the likeability of Phux.
Cheers,
Rob.
Post by Lin Yo-An
Hi folks,
Glad to announce that the first version of Phux PHP Router is released.
https://github.com/c9s/phux
Phux is basically a rewrite of PHP Roller router.
Phux provides full functional C extension and pure PHP library with the
same interface, so the extension is optional to install.
but if you install phux extension, you may enjoy the performance of routing.
Route Dispatch Benchmark (Symfony/Routing and Phux pure PHP)
https://raw.github.com/c9s/Phux/master/benchmarks/reqs.png
Cheers,
Yo-An Lin
--
E-Mail Disclaimer: Information contained in this message and any
attached documents is considered confidential and legally protected.
This message is intended solely for the addressee(s). Disclosure,
copying, and distribution are prohibited unless authorized.
--
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
Lester Caine
2014-01-06 18:24:57 UTC
Permalink
Post by Tedd Sperling
This reminds me of an oversea's client I had where they wanted to enter the American market with their Pet Shampoo. I told them they may want to pick a different domain name, but they insisted that they had properly investigated the market and had made their choice of "smellypet.com".
A year later, they contacted me and said they finally understood what I was talking about.
FCKEditor is another higher profile example ...
--
Lester Caine - G8HFL
-----------------------------
Contact - http://lsces.co.uk/wiki/?page=contact
L.S.Caine Electronic Services - http://lsces.co.uk
PHPSurgery - http://phpsurgery.org
Rainbow Digital Media - http://rainbowdigitalmedia.co.uk
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Stuart Dallas
2014-01-07 09:33:52 UTC
Permalink
Post by Tedd Sperling
This reminds me of an oversea's client I had where they wanted to enter the American market with their Pet Shampoo. I told them they may want to pick a different domain name, but they insisted that they had properly investigated the market and had made their choice of "smellypet.com".
A year later, they contacted me and said they finally understood what I was talking about.
FCKEditor is another higher profile example …
http://docs.cksource.com/FCKeditor_3.x/Design_and_Architecture/Rebranding

-Stuart
--
Stuart Dallas
3ft9 Ltd
http://3ft9.com/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Lester Caine
2014-01-07 12:46:12 UTC
Permalink
Post by Stuart Dallas
Post by Tedd Sperling
This reminds me of an oversea's client I had where they wanted to enter the American market with their Pet Shampoo. I told them they may want to pick a different domain name, but they insisted that they had properly investigated the market and had made their choice of "smellypet.com".
A year later, they contacted me and said they finally understood what I was talking about.
FCKEditor is another higher profile example …
http://docs.cksource.com/FCKeditor_3.x/Design_and_Architecture/Rebranding
A good documentation of the problem explaining why what seems like a bit of a
joke can backfire?

I'm of an age where the Windows DDK came on a stack of floppy disks. It was
quite irritating to read some of the jokes and fowl language that were spread
through the code. Something that would not be allowed these days as we can all
review the code bases. Care in the choice of names is even more important these
days?
--
Lester Caine - G8HFL
-----------------------------
Contact - http://lsces.co.uk/wiki/?page=contact
L.S.Caine Electronic Services - http://lsces.co.uk
EnquirySolve - http://enquirysolve.com/
Model Engineers Digital Workshop - http://medw.co.uk
Rainbow Digital Media - http://rainbowdigitalmedia.co.uk
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Lin Yo-An
2014-01-07 14:16:09 UTC
Permalink
https://github.com/c9s/router-benchmark/blob/master/code/dispatch.txt

Here is the updated benchmark test case.

I added a benchmark for the dispatch method call, as you see there is a
huge difference when only one route in each test case.

https://github.com/c9s/router-benchmark/blob/master/code/dispatch.php
Post by Lester Caine
Post by Stuart Dallas
Post by Tedd Sperling
Post by Tedd Sperling
This reminds me of an oversea's client I had where they wanted to
enter the American market with their Pet Shampoo. I told them they may want
to pick a different domain name, but they insisted that they had properly
investigated the market and had made their choice of "smellypet.com".
Post by Tedd Sperling
A year later, they contacted me and said they finally understood what
I was talking about.
FCKEditor is another higher profile example …
http://docs.cksource.com/FCKeditor_3.x/Design_and_Architecture/Rebranding
A good documentation of the problem explaining why what seems like a bit
of a joke can backfire?
I'm of an age where the Windows DDK came on a stack of floppy disks. It
was quite irritating to read some of the jokes and fowl language that were
spread through the code. Something that would not be allowed these days as
we can all review the code bases. Care in the choice of names is even more
important these days?
--
Lester Caine - G8HFL
-----------------------------
Contact - http://lsces.co.uk/wiki/?page=contact
L.S.Caine Electronic Services - http://lsces.co.uk
EnquirySolve - http://enquirysolve.com/
Model Engineers Digital Workshop - http://medw.co.uk
Rainbow Digital Media - http://rainbowdigitalmedia.co.uk
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--
Best Regards,

Yo-An Lin
Sebastian Krebs
2014-01-07 14:32:49 UTC
Permalink
Post by Yo-An lin
https://github.com/c9s/router-benchmark/blob/master/code/dispatch.txt
Here is the updated benchmark test case.
I added a benchmark for the dispatch method call, as you see there is a
huge difference when only one route in each test case.
https://github.com/c9s/router-benchmark/blob/master/code/dispatch.php
I can provide a router, that is even faster:

$routes = [
'/hello' => ['foo', 'bar']
];

if (isset($routes['/hello']) {
do_something($routes['/hello']);
}


I couldn't resist :)


Also (don't know, what others think) I'd only compare the matching, not the
setup. Especially because once you use a form of serialized object and for
the other you set it up programmatically ;)
Post by Yo-An lin
Post by Lester Caine
Post by Tedd Sperling
Post by Tedd Sperling
This reminds me of an oversea's client I had where they wanted to
enter the American market with their Pet Shampoo. I told them they
may want
Post by Lester Caine
Post by Tedd Sperling
to pick a different domain name, but they insisted that they had
properly
Post by Lester Caine
Post by Tedd Sperling
investigated the market and had made their choice of "smellypet.com".
Post by Tedd Sperling
A year later, they contacted me and said they finally understood
what
Post by Lester Caine
Post by Tedd Sperling
I was talking about.
FCKEditor is another higher profile example …
http://docs.cksource.com/FCKeditor_3.x/Design_and_Architecture/Rebranding
Post by Lester Caine
A good documentation of the problem explaining why what seems like a bit
of a joke can backfire?
I'm of an age where the Windows DDK came on a stack of floppy disks. It
was quite irritating to read some of the jokes and fowl language that
were
Post by Lester Caine
spread through the code. Something that would not be allowed these days
as
Post by Lester Caine
we can all review the code bases. Care in the choice of names is even
more
Post by Lester Caine
important these days?
--
Lester Caine - G8HFL
-----------------------------
Contact - http://lsces.co.uk/wiki/?page=contact
L.S.Caine Electronic Services - http://lsces.co.uk
EnquirySolve - http://enquirysolve.com/
Model Engineers Digital Workshop - http://medw.co.uk
Rainbow Digital Media - http://rainbowdigitalmedia.co.uk
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--
Best Regards,
Yo-An Lin
--
github.com/KingCrunch
Lin Yo-an
2014-01-07 15:21:44 UTC
Permalink
Post by Sebastian Krebs
$routes = [
'/hello' => ['foo', 'bar']
];
if (isset($routes['/hello']) {
do_something($routes['/hello']);
}
I couldn't resist :)
Of course you can do that. I can’t stop you.

but your route only works for very simple case.

Pux can do more complex pattern routing just like Symfony/Routing.

If you’ve read the readme file carefully, you should have knew that Pux can let you define path requirement and default value very easily, so you don’t need to write complex patterns by hands.

for example, the Pux pattern compiler support the slug & requirement feature just like Symfony/Routing, but Pux provides a better performance.

http://symfony.com/doc/current/book/routing.html#adding-requirements



The example below is copied from the README.

use Pux\Executor;

class ProductController {
public function listAction() {
return 'product list';
}
public function itemAction($id) {
return "product $id";
}
}
$mux = new Pux\Mux;
$mux->add('/product', ['ProductController','listAction']);
$mux->add('/product/:id', ['ProductController','itemAction'] , [
'require' => [ 'id' => '\d+', ],
'default' => [ 'id' => '1', ]
]);
$route = $mux->dispatch('/product/1');
Executor::execute($route);


And here comes the example from Symfony/Routing:

use Symfony\Component\Routing\RouteCollection;
use Symfony\Component\Routing\Route;

$collection = new RouteCollection();
$collection->add('blog', new Route('/blog/{page}', array(
'_controller' => 'AcmeBlogBundle:Blog:index',
'page' => 1,
), array(
'page' => '\d+',
)));

return $collection;
Post by Sebastian Krebs
Also (don't know, what others think) I'd only compare the matching, not the setup. Especially because once you use a form of serialized object and for the other you set it up programmatically ;)
it’s not testing setup. if you've checked the dispatch test case (L40-L50 in https://github.com/c9s/router-benchmark/blob/master/code/dispatch.php)

it only calls the dispatch method in the iteration block.
Post by Sebastian Krebs
Post by Lester Caine
Post by Stuart Dallas
Post by Tedd Sperling
Post by Tedd Sperling
This reminds me of an oversea's client I had where they wanted to
enter the American market with their Pet Shampoo. I told them they may want
to pick a different domain name, but they insisted that they had properly
investigated the market and had made their choice of "smellypet.com".
Post by Tedd Sperling
A year later, they contacted me and said they finally understood what
I was talking about.
FCKEditor is another higher profile example …
http://docs.cksource.com/FCKeditor_3.x/Design_and_Architecture/Rebranding
A good documentation of the problem explaining why what seems like a bit
of a joke can backfire?
I'm of an age where the Windows DDK came on a stack of floppy disks. It
was quite irritating to read some of the jokes and fowl language that were
spread through the code. Something that would not be allowed these days as
we can all review the code bases. Care in the choice of names is even more
important these days?
--
Lester Caine - G8HFL
-----------------------------
Contact - http://lsces.co.uk/wiki/?page=contact
L.S.Caine Electronic Services - http://lsces.co.uk
EnquirySolve - http://enquirysolve.com/
Model Engineers Digital Workshop - http://medw.co.uk
Rainbow Digital Media - http://rainbowdigitalmedia.co.uk
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--
Best Regards,
Yo-An Lin
--
github.com/KingCrunch
Sebastian Krebs
2014-01-07 15:37:15 UTC
Permalink
Post by Sebastian Krebs
$routes = [
'/hello' => ['foo', 'bar']
];
if (isset($routes['/hello']) {
do_something($routes['/hello']);
}
I couldn't resist :)
Of course you can do that. I can’t stop you.
but your route only works for very simple case.
Pux can do more complex pattern routing just like Symfony/Routing.
Thats what I wanted to tell you: You benchmark a single, very trivial case.
For this case (as mentioned) I don't need a router at all, but thats not
the point of a router. Of course both implementations can do more and thats
what most interest: How do they behave in something similar to "real world"
scenarios :)
Post by Sebastian Krebs
If you’ve read the readme file carefully, you should have knew that Pux
can let you define path requirement and default value very easily, so you
don’t need to write complex patterns by hands.
for example, the Pux pattern compiler support the slug & requirement
feature just like Symfony/Routing, but Pux provides a better performance.
Something veeery different: How easy is it to replace Symfony2s router with
your one? If I use the Symfony2-Router, it is probably not, because it
looks nice, but I use it within something Symfony-HTTP-Kernel based. So
even if you one is much much faster, maybe it doesn't help me?
I can imagine, that it is quite easy to implement a Symfony2-Router-class,
that just pass-through the request to your implementation. A benchmark
about this would be interesting too: How much is the speedup in my
_existing_ application simply by _replacing_ (and not rewriting too much)
the router?
Post by Sebastian Krebs
http://symfony.com/doc/current/book/routing.html#addiAnd saying this mine
is probably fang-requirements<http://symfony.com/doc/current/book/routing.html#adding-requirements>
The example below is copied from the README.
use Pux\Executor;
class ProductController {
public function listAction() {
return 'product list';
}
public function itemAction($id) {
return "product $id";
}
}
$mux = new Pux\Mux;
$mux->add('/product', ['ProductController','listAction']);
$mux->add('/product/:id', ['ProductController','itemAction'] , [
'require' => [ 'id' => '\d+', ],
'default' => [ 'id' => '1', ]
]);
$route = $mux->dispatch('/product/1');
Executor::execute($route);
use Symfony\Component\Routing\RouteCollection;use Symfony\Component\Routing\Route;
$collection = new RouteCollection();$collection->add('blog', new Route('/blog/{page}', array(
'_controller' => 'AcmeBlogBundle:Blog:index',
'page' => 1,), array(
'page' => '\d+',)));
return $collection;
Also (don't know, what others think) I'd only compare the matching, not
the setup. Especially because once you use a form of serialized object and
for the other you set it up programmatically ;)
it’s not testing setup. if you've checked the dispatch test case (L40-L50
in https://github.com/c9s/router-benchmark/blob/master/code/dispatch.php)
it only calls the dispatch method in the iteration block.
Post by Tedd Sperling
Post by Lester Caine
Post by Tedd Sperling
Post by Tedd Sperling
This reminds me of an oversea's client I had where they wanted to
enter the American market with their Pet Shampoo. I told them they
may want
Post by Lester Caine
Post by Tedd Sperling
to pick a different domain name, but they insisted that they had
properly
Post by Lester Caine
Post by Tedd Sperling
investigated the market and had made their choice of "smellypet.com
".
Post by Lester Caine
Post by Tedd Sperling
Post by Tedd Sperling
A year later, they contacted me and said they finally understood
what
Post by Lester Caine
Post by Tedd Sperling
I was talking about.
FCKEditor is another higher profile example …
http://docs.cksource.com/FCKeditor_3.x/Design_and_Architecture/Rebranding
Post by Lester Caine
A good documentation of the problem explaining why what seems like a bit
of a joke can backfire?
I'm of an age where the Windows DDK came on a stack of floppy disks. It
was quite irritating to read some of the jokes and fowl language that
were
Post by Lester Caine
spread through the code. Something that would not be allowed these days
as
Post by Lester Caine
we can all review the code bases. Care in the choice of names is even
more
Post by Lester Caine
important these days?
--
Lester Caine - G8HFL
-----------------------------
Contact - http://lsces.co.uk/wiki/?page=contact
L.S.Caine Electronic Services - http://lsces.co.uk
EnquirySolve - http://enquirysolve.com/
Model Engineers Digital Workshop - http://medw.co.uk
Rainbow Digital Media - http://rainbowdigitalmedia.co.uk
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--
Best Regards,
Yo-An Lin
--
github.com/KingCrunch
--
github.com/KingCrunch
Lin Yo-an
2014-01-07 15:54:41 UTC
Permalink
Thats what I wanted to tell you: You benchmark a single, very trivial case. For this case (as mentioned) I don't need a router at all, but thats not the point of a router. Of course both implementations can do more and thats what most interest: How do they behave in something similar to "real world" scenarios :)
I think the minimal case already shows the difference. :) but I think it’s still OK to add more complex test case for “real world” scenarios.
Something veeery different: How easy is it to replace Symfony2s router with your one? If I use the Symfony2-Router, it is probably not, because it looks nice, but I use it within something Symfony-HTTP-Kernel based. So even if you one is much much faster, maybe it doesn't help me?
I can imagine, that it is quite easy to implement a Symfony2-Router-class, that just pass-through the request to your implementation. A benchmark about this would be interesting too: How much is the speedup in my _existing_ application simply by _replacing_ (and not rewriting too much) the router?
Well, I don’t think you should replace your router if you’re already using Symfony 2. :) and I actually don’t want to make it fully compatible with Symfony 2.

Also I can't make sure whether Pux can help you or not. Or tell you how easy is it to replace Symfony 2 Router with Pux, I can’t tell you the answer because I don’t have much experience about using Symfony framework.

Pux is an experiment, which is implemented in only few days, to test a my concept - "there is more than one way to do it” and it (routing) can be done smarter & faster.
http://symfony.com/doc/current/book/routing.html#addiAnd saying this mine is probably fang-requirements
The example below is copied from the README.
use Pux\Executor;
class ProductController {
public function listAction() {
return 'product list';
}
public function itemAction($id) {
return "product $id";
}
}
$mux = new Pux\Mux;
$mux->add('/product', ['ProductController','listAction']);
$mux->add('/product/:id', ['ProductController','itemAction'] , [
'require' => [ 'id' => '\d+', ],
'default' => [ 'id' => '1', ]
]);
$route = $mux->dispatch('/product/1');
Executor::execute($route);
use Symfony\Component\Routing\RouteCollection;
use Symfony\Component\Routing\Route;
$collection = new RouteCollection();
$collection->add('blog', new Route('/blog/{page}', array(
'_controller' => 'AcmeBlogBundle:Blog:index',
'page' => 1,
), array(
'page' => '\d+',
)));
return $collection;
Post by Sebastian Krebs
Also (don't know, what others think) I'd only compare the matching, not the setup. Especially because once you use a form of serialized object and for the other you set it up programmatically ;)
it’s not testing setup. if you've checked the dispatch test case (L40-L50 in https://github.com/c9s/router-benchmark/blob/master/code/dispatch.php)
it only calls the dispatch method in the iteration block.
Post by Sebastian Krebs
Post by Lester Caine
Post by Stuart Dallas
Post by Tedd Sperling
Post by Tedd Sperling
This reminds me of an oversea's client I had where they wanted to
enter the American market with their Pet Shampoo. I told them they may want
to pick a different domain name, but they insisted that they had properly
investigated the market and had made their choice of "smellypet.com".
Post by Tedd Sperling
A year later, they contacted me and said they finally understood what
I was talking about.
FCKEditor is another higher profile example …
http://docs.cksource.com/FCKeditor_3.x/Design_and_Architecture/Rebranding
A good documentation of the problem explaining why what seems like a bit
of a joke can backfire?
I'm of an age where the Windows DDK came on a stack of floppy disks. It
was quite irritating to read some of the jokes and fowl language that were
spread through the code. Something that would not be allowed these days as
we can all review the code bases. Care in the choice of names is even more
important these days?
--
Lester Caine - G8HFL
-----------------------------
Contact - http://lsces.co.uk/wiki/?page=contact
L.S.Caine Electronic Services - http://lsces.co.uk
EnquirySolve - http://enquirysolve.com/
Model Engineers Digital Workshop - http://medw.co.uk
Rainbow Digital Media - http://rainbowdigitalmedia.co.uk
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--
Best Regards,
Yo-An Lin
--
github.com/KingCrunch
--
github.com/KingCrunch
Lin Yo-an
2014-01-09 07:40:23 UTC
Permalink
Thats what I wanted to tell you: You benchmark a single, very trivial case. For this case (as mentioned) I don't need a router at all, but thats not the point of a router. Of course both implementations can do more and thats what most interest: How do they behave in something similar to "real world" scenarios :)
If the minimal test case does not show the different, then we will need a complex sample to test them.

The minimal test case already shows the huge difference, so there is no much need to test a complex test case actually.

I added more benchmarks for Klein.php, Ham, and Aura.

Aura is the second fastest router. but Pux is still faster 2.5x than Aura router:

https://github.com/c9s/router-benchmark/blob/master/code/dispatch.txt
Lin Yo-an
2014-01-09 07:49:36 UTC
Permalink
I also tested your case "php array as a router”.

the php array test case is the fastest because there is no any function call. but using php array to route does not help the development and it’s hard to maintain or extend:

Rate Mem php array pux extension aura ham symfony/routing klein
php array 186.61K/s 0B -- -69% -21% -8% -1% -1%
pux extension 129.4K/s 0B 144% -- -31%-12% -1% -1%
aura 40.26K/s 0B 463% 321% ---41% -5% -4%
ham 16.74K/s 0B 1114% 773% 240% -- -12% -11%
symfony/routing 2.07K/s 524K 9012% 6249%1944%808% -- -91%
klein 1.89K/s 262K 9861% 6838%2127%884% 109% --

note that there is only 1.3~1.4x different between plain php array and pux.

code - PHP Array as Router:

// plain php
$phparray = array(
'/hello' => array( 'hello' )
);
$bench->iterate( 'php array' , function() use ($phparray) {
if ( isset($phparray['/hello']) ) {
$route = $phparray['/hello'];
}
});



c9s
http://github.com/c9s
Post by Lin Yo-an
Thats what I wanted to tell you: You benchmark a single, very trivial case. For this case (as mentioned) I don't need a router at all, but thats not the point of a router. Of course both implementations can do more and thats what most interest: How do they behave in something similar to "real world" scenarios :)
If the minimal test case does not show the different, then we will need a complex sample to test them.
The minimal test case already shows the huge difference, so there is no much need to test a complex test case actually.
I added more benchmarks for Klein.php, Ham, and Aura.
https://github.com/c9s/router-benchmark/blob/master/code/dispatch.txt
Lester Caine
2014-01-09 12:02:23 UTC
Permalink
I also tested your case "php array as a router”.
the php array test case is the fastest because there is no any function call.
but using php array to route does not help the development and it’s hard to
Going off on a slight tangent here, but I feel that it is important. I'm just
moving from Apache to nginx to provide the base static serving and am now
running php only for php files. I'm still using the same structure that I've
used for many years where each area has it's own 'directory', so rewrite is used
as part of the routing, and reduces the problem to manageable chunks. So I am at
something of a loss to see the advantage of building a large routing application
when the php end of things can be simplified to smaller faster modules? In my
model the bulk of the routing has been done even before php is accessed?
--
Lester Caine - G8HFL
-----------------------------
Contact - http://lsces.co.uk/wiki/?page=contact
L.S.Caine Electronic Services - http://lsces.co.uk
EnquirySolve - http://enquirysolve.com/
Model Engineers Digital Workshop - http://medw.co.uk
Rainbow Digital Media - http://rainbowdigitalmedia.co.uk
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Lin Yo-an
2014-01-09 15:21:40 UTC
Permalink
I also tested your case "php array as a router”.
the php array test case is the fastest because there is no any function call.
but using php array to route does not help the development and it’s hard to
Going off on a slight tangent here, but I feel that it is important. I'm just moving from Apache to nginx to provide the base static serving and am now running php only for php files. I'm still using the same structure that I've used for many years where each area has it's own 'directory', so rewrite is used as part of the routing, and reduces the problem to manageable chunks. So I am at something of a loss to see the advantage of building a large routing application when the php end of things can be simplified to smaller faster modules? In my model the bulk of the routing has been done even before php is accessed?
You are right. I used to use the same structure as yours to develop our application, and it works when you start small.

When your application is getting bigger and bigger, it will be painful to maintain the whole directory structure and these include paths, and you will want to centralise these common code/library/controller/methods and dispatch your controller from the same place.

It’s right to let HTTP server do the routing and get best performance, but doing this way increases the complexity of including libraries (include path problem). for example, you have a directory structure which has 4+ levels, when you changing one of them to elsewhere, you need to modify all include paths one by one, and you need to trace all files that used the changed file.

So the best way to simplify larger application structure is to use a router to dispatch paths from the same place, but sacrifice performance (the reloading overhead).

Some frameworks like React, which does not depend on Apache2 or Nginx. it also doesn't require reloading.

If you look into React framework, it’s actually running PHP process persistently, and you don’t need to maintain the directory or reloading PHP files anymore. and the routing speed becomes more important on these frameworks.

In the future, people will run PHP just like other languages do (running a persistent http server in the backend). although it’s still unstable for production servers.


c9s
http://github.com/c9s
--
Lester Caine - G8HFL
-----------------------------
Contact - http://lsces.co.uk/wiki/?page=contact
L.S.Caine Electronic Services - http://lsces.co.uk
EnquirySolve - http://enquirysolve.com/
Model Engineers Digital Workshop - http://medw.co.uk
Rainbow Digital Media - http://rainbowdigitalmedia.co.uk
--
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
Lester Caine
2014-01-09 15:41:35 UTC
Permalink
Post by Lin Yo-an
It’s right to let HTTP server do the routing and get best performance, but doing this way increases the complexity of including libraries (include path problem). for example, you have a directory structure which has 4+ levels, when you changing one of them to elsewhere, you need to modify all include paths one by one, and you need to trace all files that used the changed file.
It is that 'claim' which I find very confusing since properly designed you do
not need to go 4 levels deep if the system is designed right initially. It's
this which creates complexity, when a single 'external' library directory should
encapsulate all the third party material. It's all this 'automatic loading'
which is creating the complexity when a simple fixed structure would speed up
even that process. But then my database is the persistent layer and the bulk of
the content is maintained in the database cache.
--
Lester Caine - G8HFL
-----------------------------
Contact - http://lsces.co.uk/wiki/?page=contact
L.S.Caine Electronic Services - http://lsces.co.uk
EnquirySolve - http://enquirysolve.com/
Model Engineers Digital Workshop - http://medw.co.uk
Rainbow Digital Media - http://rainbowdigitalmedia.co.uk
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Loading...