دراسة لمقارنة ASP و PHP من موقع فرنسي و محايد نوعا ما ..
كثر الكلام حول المقارنة بين ASP و PHP ، أيها أفضل ؟
الأجابة بكل بساطة :
أستخدم كل أداة بمكانها الصحيح .
المعنى أستخدم ال PHP في مكانها الأصلي على منصات ال Linux
و ال ASP على منصات الويندوز ..
و هذه الدراسة تؤيد أن ال PHP تتفوق على ASP ب ؟ أقرأ الدراسة و أنت تعرف.
PHP و ASP بدون التعامل مع قواعد البيانات:
كود:
by looking at the first curve of the benchmark (compilation without access data base),
one sees that two languages remain appreciably equivalent until 300 requêtes/s.
Beyond, the PHP is more successful. By taking a coefficient of 2,5 for the peaks
of traffic, the 300 requêtes/s of the PHP correspond to 10,37 million pages seen
a day. So, by taking into account only the aspect compilation, until 10 million
pages seen a day ASP AND PHP are equivalent. Beyond, PHP sets the best.
عند 300 طلب بالثانية اللغتين متساويتين
أكثر من هذا لغة PHP تتفوق على ال ASP
300 طلب بالثانية = 10،37 مليون طلب لصفحة بال PHP
300 طلب بالثانية = 10 مليون طلب لصفحة بال ASP
الفرق 10,37/10 = 1 % بس
النتيجة عند 10 مليون طلب لصفحة باليوم تكون اللغتين متكافئتين بالسرعة...
جدول الأرقام :
http://www.devparadise.com/technoweb...ch/d55a445.asp
رسم بياني:

PHP و ASP مع قواعد البيانات:
تمت المقارنة بين هذه التشكيلة
[أصفر] PHP + MYSQL 3.23.36
[أزرق] PHP + persevering connections + MYSQL 3.23.36
[بيج] PHP + PostgreSQL 7.0.3
[وردي] PHP + persevering connections + PostgreSQL 7.0.3
[أخضر] ASP + SQL SERVER on 2000
[بنفسجي] ASP + MYODBC 2.50.39 + MYSQL 3.23.36
[أحمر] ASP + pgODBC 7.01 + PostgreSQL 7.0.3
النتيجة:
الأختبارات :
-- أدخال البيانات إلى قاعدة البيانات
-- عرض البيانات من قاعدة البيانات
كود:
At first, one can notice that the performances of the couple PHP - MySQL
decrease dangerously with the number of simultaneous connections.
So, it's better not to hold(retain) this solution for sites of strong traffic.
Then the choice of the solution depends on the type of site to be
accommodated. For sites with contents, the on-line catalogs or
the search engines, the majority of pages to be posted(be shown)
are lists (corresponds to the first simulation). Consequently,
in these cases, the best solution is the couple
ASP - PostgreSQL: 37 requêtes/s, or 1,27 million pages seen
a day. For those that wish to keep(guard) the same operating system
on the waiter(server) Web and the basic waiter(server) given,
ASP - SQL SERVER 2000 stays an interesting solution: 25 requêtes/s,
or 864 000 pages seen a day.
On the other hand, if the site to be accommodated is foreseen
for the delivery of blindfolds or quite other service consisting in
posting(showing) an element of a table of the data base, the last test of
the benchmark reveals that solution PHP - PostgreSQL is the best:
238 requêtes/s, is 8,22 million pages seen a day. The couple
ASP - PostgreSQL has still interesting performances: 193 requêtes/s,
or 6,67 million pages but access to fields of type MEMO ( BLOB)
for the couple ASP - PostgreSQL is more complicated than for
the couple ASP - SQL Server
أنخفظ أداء PHP - MySQL بشكل خطير عند زيادة عدد الأتصالات المفتوح مع قاعدة البيانات .
لذا يفضل البحث عن حلول أخرى عند أزدحام الموقع بالزوار...
أفضل الحلول من هذه الدراسة هو
ASP - PostgreSQL: 37 طلب بالثانية = 1,27 مليون صفحة باليوم
ASP - SQL SERVER 2000 25 طلب بالثانية = 864000 مليون صفحة باليوم
أدخال البيانات :
PHP - PostgreSQL 238 طلب بالثانية = 8,22 مليون صفحة باليوم
ASP - PostgreSQL 193 طلب بالثانية = 6,67 مليون صفحة باليوم
جدول الأرقام :
http://www.devparadise.com/technoweb...ch/d55a446.asp
رسم بياني:

ملاحظاتي على الدراسة:
سبب تفوق PostgreSQL على SQL SERVER 2000
لم تنصف هذه الدراسة بحق SQL SERVER 2000
السبب:
أستخدام جمل أستعلام مختلفة بالمقارنة
جملة أستعلام SQL SERVER 2000
كود:
select * from
(select top 20 * from
(select top 3020 * from test order by idtest)
t1 order by idtest DESC
)
t2 order by idtest
جملة أستعلام PostgreSQL
كود:
SELECT * FROM test order by idtest LIMIT 20 , 3000
جملة الأستعلام الخاصة ب SQL SERVER 2000 تكلف الكثير
تطلب هذه الجملة البيانات من نفس الجدول ثلاث مرات
1 - طلب 3020 حقل من جدول test
2 - طلب أول 20 حقل من الحقول ال 3020
3 - سرد ناتج الخطوتين السابقتين..
جملة الأستعلام الخاصة ب PostgreSQL تطلب البيانات مرة واحدة ...
هذا هو أحد أسباب تفوق PostgreSQL على SQL SERVER 2000 ، المفروض أستخدام نفس جمل الأستعلام ...
SQL SERVER 2000 لا يدعم أستخدام LIMIT لتحديد عدد الحقول ، و لكنة يستخدم طرق أخرى لعمل ذلك ، منها SET ROWCOUNT=20 ...
LIMIT هي أضافة تختص بها بعض قواعدة البيانات مثل PostgreSQL ،MySQL و ليست من ضمن SQL-92 standard ..
لجعل هذه الدراسة منصفة : يجب أستخدام Stored Procedure بدل جمل الأستعلام في SQL SERVER 2000 أو أستبدال
جملة أستعلام SQL SERVER 2000 بهذه:
كود:
SET ROWCOUNT=20
SELECT Top 3020 * FROM test order by idtest DESC
حتى هذه الجملة تختار 3020 حقل و بعد ذلك تختار أول 20 حقل ...
ملاحظة أخرى :
أستخدموا هذه الكود لعرض حقول البيانات
كود:
While not rs.eof
'code
Rs. MoveNext
Wend
هذه الطريقة مكلفة ، تعرض البيانات حقل حقل ،هناك طريقة أفضل و أسرع بكثير ، تحميل جميع الحقول بمصفوفة
كود:
Dim AllRecords
AllRecords=Rs.GetRows()
مراجع:
صفحة الدراسة
باللغة الفرنسية
http://www.devparadise.com/technoweb/sys/bench/D55.asp
الترجمة إلى الأنجليزية
http://www.translate.ru/eng/url/tu_b...ench%2Fd55.asp