Author: mlebas@labeille.net
Date: Thu Jun 8 17:12:54 2006
New Revision: 3526
Log:
Comparaison de perfs entre 2 versions SPIP
Voir le README.txt
Added:
_dev_/README.txt
_dev_/cmpb (with props)
_dev_/cmpv (with props)
_dev_/svn_priv
_dev_/svn_pub
_dev_/work_priv
_dev_/work_pub
Added: _dev_/README.txt
--- _dev_/README.txt (added)
+++ _dev_/README.txt Thu Jun 8 17:12:54 2006
@@ -0,0 +1,11 @@
+# 2006 Jun 8 - Marc Lebas
+Comparaison de performances entre 2 versions SPIP
+
+ cmpb : script de comparaison partie publique
+ cmpv : script de comparaison partie privee
+ *_pub: jeu d'URL publique (exemples 1.8 et 1.9)
+ *_priv: jeu d'URL privees (exemples 1.8 et 1.9)
+
+Voir les explications dans les scripts
+
+Teste sous MacOS, devrait marcher sous Linux et Solaris
Added: _dev_/cmpb
--- _dev_/cmpb (added)
+++ _dev_/cmpb Thu Jun 8 17:12:54 2006
@@ -0,0 +1,73 @@
+#!/bin/sh
+# Performances SPIP pour la partie PUBLIQUE
+# On mesure le gain d'une version TST par rapport a une version REF
+# au moyen de 2 mesures (avec et sans cache) dont chacune
+# comporte NE echantillons ; NE est en parametre du script (defaut = 1)
+#
+# Gain = (temps_REF - temps_TST)/temps_REF
+#
+# Les squelettes et bases SQL sont censes etre identiques pour TST et REF
+# la mesure est faite par 'time wget' avec une liste d'URL significative
+#
+NE=1
+#
+# Ici on definit REF et TST avec le chemin du CACHE et celui du jeu d'URLs
+# Les chemins doivent etre absolus
+#
+WWW=/Library/WebServer/Documents
+CACHE_REF=$WWW/work/CACHE
+CACHE_TST=$WWW/svn/CACHE
+URL_REF=$HOME/perf/work_pub
+URL_TST=$HOME/perf/svn_pub
+
+choix_time () {
+ # time doit accepter -p pour garantir un format standard
+ # Suivant les Unix, le bon time peut etre dans /usr/bin
+ TIME=time
+ time -p pwd
+ if [ $? -ne 0 ]; then TIME=/usr/bin/time; fi
+}
+
+echantillon () {
+ # on utilise un repertoire de travail tmp pour wget
+ # Destruction du cache et de tmp
+ rm -rf tmp $1/* > /dev/null 2>&1
+ mkdir tmp
+ cd tmp
+ printf "###### $2 sans cache: "
+ $TIME -p wget -q -i $3
+ printf "###### $2 avec cache: "
+ $TIME -p wget -q -i $3
+ cd ..
+}
+
+boucle () {
+ CNT=0
+ >res
+ while true; do
+ if [ $CNT -eq $NE ]; then return; fi
+ CNT=`expr $CNT + 1`
+ echantillon $CACHE_REF REF $URL_REF >> res 2>&1
+ echantillon $CACHE_TST TST $URL_TST >> res 2>&1
+ done
+}
+
+#
+# Main
+#
+if [ ! -z "$1" ]; then NE=$1; fi
+# Pour la portabilite on choisit la commande time
+choix_time >/dev/null 2>&1
+# La mesure
+echo "Les resultats sont dans le fichier res"
+boucle
+#
+# Calcul et affichage
+#
+printf "\nREF sans cache ; REF avec cache ; TST sans cache ; TST avec cache ; Gain sans cache ; Gain avec cache\n"
+awk '/REF sans/ {A=$6};\
+ /REF avec/ {B=$6};\
+ /TST sans/ {C=$6};\
+ /TST avec/ { n +=1; s += 100*(A-C)/A ; t += 100*(B-$6)/B};\
+ /TST avec/ {print A"; "B"; "C"; "$6"; "100*(A-C)/A"% ; "100*(B-$6)/B"%"};\
+END { print "\n Gain moyen REF -> TST =", s/n"%", "sans cache", t/n"%", "avec cache" } ' res
Propchange: _dev_/cmpb
------------------------------------------------------------------------------
svn:executable =
Added: _dev_/cmpv
--- _dev_/cmpv (added)
+++ _dev_/cmpv Thu Jun 8 17:12:54 2006
@@ -0,0 +1,66 @@
+#!/bin/sh
+# Performances SPIP pour la partie PRIVEE
+# On mesure le gain d'une version TST par rapport a une version REF
+# au moyen d'une mesure comportant NE echantillons
+# NE est en parametre du script (defaut = 1)
+#
+# Gain = (temps_REF - temps_TST)/temps_REF
+#
+# Les bases SQL sont censes etre identiques pour TST et REF
+# la mesure est faite par 'time wget' avec une liste d'URL significative
+#
+NE=1
+#
+# Ici on definit REF et TST avec le jeu d'URLs
+# Les chemins doivent etre absolus
+#
+URL_REF=$HOME/perf/work_priv
+URL_TST=$HOME/perf/svn_priv
+
+choix_time () {
+ # time doit accepter -p pour garantir un format standard
+ # Suivant les Unix, le bon time peut etre dans /usr/bin
+ TIME=time
+ time -p pwd
+ if [ $? -ne 0 ]; then TIME=/usr/bin/time; fi
+}
+
+echantillon () {
+ # on utilise un repertoire de travail tmp pour wget
+ # Destruction de tmp
+ rm -rf tmp > /dev/null 2>&1
+ mkdir tmp
+ cd tmp
+ printf "###### $1 "
+ $TIME -p wget -q -i $2
+ cd ..
+}
+
+boucle () {
+ CNT=0
+ >res
+ while true; do
+ if [ $CNT -eq $NE ]; then return; fi
+ CNT=`expr $CNT + 1`
+ echantillon REF $URL_REF >> res 2>&1
+ echantillon TST $URL_TST >> res 2>&1
+ done
+}
+
+#
+# Main
+#
+if [ ! -z "$1" ]; then NE=$1; fi
+# Pour la portabilite on choisit la commande time
+choix_time >/dev/null 2>&1
+# La mesure
+echo "Les resultats sont dans le fichier res"
+boucle
+#
+# Calcul et affichage
+#
+printf "\nREF; TST ; Gain\n"
+awk '/REF / {A=$4};\
+ /TST / { n +=1; s += 100*(A-$4)/A};\
+ /TST / {print A"; "$4"; "100*(A-$4)/A"%"};\
+ END {print "Gain REF -> TST =",s/n,"%"}' res
Propchange: _dev_/cmpv
------------------------------------------------------------------------------
svn:executable =
Added: _dev_/svn_priv
--- _dev_/svn_priv (added)
+++ _dev_/svn_priv Thu Jun 8 17:12:54 2006
@@ -0,0 +1,66 @@
+http://localhost:8888/svn/ecrire/?exec=articles?article=id_article=1
+http://localhost:8888/svn/ecrire/?exec=articles?article=id_article=13
+http://localhost:8888/svn/ecrire/?exec=articles?article=id_article=14
+http://localhost:8888/svn/ecrire/?exec=articles?article=id_article=15
+http://localhost:8888/svn/ecrire/?exec=articles?article=id_article=16
+http://localhost:8888/svn/ecrire/?exec=articles?article=id_article=20
+http://localhost:8888/svn/ecrire/?exec=articles?article=id_article=21
+http://localhost:8888/svn/ecrire/?exec=articles?article=id_article=22
+http://localhost:8888/svn/ecrire/?exec=articles?article=id_article=24
+http://localhost:8888/svn/ecrire/?exec=articles?article=id_article=25
+http://localhost:8888/svn/ecrire/?exec=articles?article=id_article=26
+http://localhost:8888/svn/ecrire/?exec=articles?article=id_article=27
+http://localhost:8888/svn/ecrire/?exec=articles?article=id_article=29
+http://localhost:8888/svn/ecrire/?exec=articles?article=id_article=30
+http://localhost:8888/svn/ecrire/?exec=articles?article=id_article=31
+http://localhost:8888/svn/ecrire/?exec=articles?article=id_article=32
+http://localhost:8888/svn/ecrire/?exec=articles?article=id_article=34
+http://localhost:8888/svn/ecrire/?exec=articles?article=id_article=35
+http://localhost:8888/svn/ecrire/?exec=articles?article=id_article=36
+http://localhost:8888/svn/ecrire/?exec=articles?article=id_article=38
+http://localhost:8888/svn/ecrire/?exec=articles?article=id_article=39
+http://localhost:8888/svn/ecrire/?exec=articles?article=id_article=4
+http://localhost:8888/svn/ecrire/?exec=articles?article=id_article=40
+http://localhost:8888/svn/ecrire/?exec=articles?article=id_article=41
+http://localhost:8888/svn/ecrire/?exec=articles?article=id_article=45
+http://localhost:8888/svn/ecrire/?exec=articles?article=id_article=47
+http://localhost:8888/svn/ecrire/?exec=articles?article=id_article=48
+http://localhost:8888/svn/ecrire/?exec=articles?article=id_article=52
+http://localhost:8888/svn/ecrire/?exec=articles?article=id_article=53
+http://localhost:8888/svn/ecrire/?exec=articles?article=id_article=54
+http://localhost:8888/svn/ecrire/?exec=articles?article=id_article=55
+http://localhost:8888/svn/ecrire/?exec=articles?article=id_article=56
+http://localhost:8888/svn/ecrire/?exec=articles?article=id_article=57
+http://localhost:8888/svn/ecrire/?exec=articles?article=id_article=58
+http://localhost:8888/svn/ecrire/?exec=articles?article=id_article=59
+http://localhost:8888/svn/ecrire/?exec=articles?article=id_article=60
+http://localhost:8888/svn/ecrire/?exec=articles?article=id_article=61
+http://localhost:8888/svn/ecrire/?exec=articles?article=id_article=62
+http://localhost:8888/svn/ecrire/?exec=articles?article=id_article=63
+http://localhost:8888/svn/ecrire/?exec=articles?article=id_article=64
+http://localhost:8888/svn/ecrire/?exec=articles?article=id_article=65
+http://localhost:8888/svn/ecrire/?exec=articles?article=id_article=66
+http://localhost:8888/svn/ecrire/?exec=articles?article=id_article=67
+http://localhost:8888/svn/ecrire/?exec=articles?article=id_article=68
+http://localhost:8888/svn/ecrire/?exec=articles?article=id_article=69
+http://localhost:8888/svn/ecrire/?exec=auteurs
+http://localhost:8888/svn/ecrire/?exec=breves_voir?breve=id_breve=0
+http://localhost:8888/svn/ecrire/?exec=breves_voir?breve=id_breve=10
+http://localhost:8888/svn/ecrire/?exec=breves_voir?breve=id_breve=12
+http://localhost:8888/svn/ecrire/?exec=breves_voir?breve=id_breve=14
+http://localhost:8888/svn/ecrire/?exec=breves_voir?breve=id_breve=18
+http://localhost:8888/svn/ecrire/?exec=breves_voir?breve=id_breve=19
+http://localhost:8888/svn/ecrire/?exec=breves_voir?breve=id_breve=21
+http://localhost:8888/svn/ecrire/?exec=breves_voir?breve=id_breve=4
+http://localhost:8888/svn/ecrire/?exec=breves_voir?breve=id_breve=5
+http://localhost:8888/svn/ecrire/?exec=breves_voir?breve=id_breve=6
+http://localhost:8888/svn/ecrire/?exec=breves_voir?breve=id_breve=7
+http://localhost:8888/svn/ecrire/?exec=mots_tous
+http://localhost:8888/svn/ecrire/?exec=naviguer?rubrique=id_rubrique=1
+http://localhost:8888/svn/ecrire/?exec=naviguer?rubrique=id_rubrique=2
+http://localhost:8888/svn/ecrire/?exec=naviguer?rubrique=id_rubrique=3
+http://localhost:8888/svn/ecrire/?exec=naviguer?rubrique=id_rubrique=4
+http://localhost:8888/svn/ecrire/?exec=naviguer?rubrique=id_rubrique=6
+http://localhost:8888/svn/ecrire/?exec=naviguer?rubrique=id_rubrique=8
[... 241 lines stripped ...]