|
|||
|
I have done some testing and benchmarking.
CSV - .mo (gettext) First test set - identical translations. ================================== ;;;;;;;;;;;;;;;;;;;;;;Testing CSV;;;;;;;;;;;;;;;;;;;;;;;;;; ================================== 5000 translations. Single words no longer then 10 letters each. The CSV file size: 120K Five tests: 1:0.18561601638794 2:0.14141798019409 3:0.13992500305176 4:0.13213515281677 5:0.1428120136261 5000 translations. Multiple long string words about 15 words each. The CSV file size: 1.6Mb Five tests: 1:0.17582893371582 2:0.17163300514221 3:0.1882631778717 4:0.20854091644287 5:0.17210984230042 --- I then converted the CSV into .PO then from PO to MO ================================== ;;;;;;;;;;;;;;;;;;;;;;Testing GETTEXT;;;;;;;;;;;;;;;;;;;;;;;;;; ================================== 5000 translations. Single words no longer then 10 letters each. The MO file size: 194K Five tests: 1:0.20350193977356 2:0.20002007484436 3:0.20459699630737 4:0.20647192001343 5:0.20419096946716 5000 translations. Multiple long string words about 15 words each. The MO file size: 1.6Mb Five tests: 1:0.21402502059937 2:0.22229099273682 3:0.21480894088745 4:0.21827602386475 5:0.21279406547546 --======================= What does this tell us? I really don-t know. A few observations can be drawn out however. Using CSV the standard deviation of spread is far greater. It appears as though you get a lot more consistent times with MO files. Interestingly it looks as though CSV are somewhat faster. Even for the smaller files which suprised me. I ran one more test on a 8Mb .mo I downloaded the entire POT file for the KDE developers environment and compiled it in the .MO 8.5M .mo run time - > 3.964830160141 I tried to convert the PO to a CSV but couldnt, so I had to make my own huge CSV. This CSV had 30k rows (ALOT more then the PO) and was larger in file size. And it still performed 4 times better. 10Mb CSV run time - >0.97681403160095 ============================ My question is, why is it performing better when Gettext is understood to be the best performer? Last edited by Kalyse : 06-08-2008 at 10:26 AM. |
|
|||
|
The current development version of zend framework has a rewritten CSV engine that should be a lot faster (it uses fgetcsv instead of parsing the csv file itself).
As to your question about how csv could be faster than gettext when the reverse is claimed? I would guess that nobody actually tested it and everyone just assumed that because gettext is faster on natively compiled platforms, it would be faster on PHP also. |
![]() |
| Thread Tools | |
| Display Modes | |
|
|