On Thu, Apr 19, 2007 at 07:26:21PM +0200, Andreas Pauley wrote:
>
> With pootle_logos_prefs.patch I changed the except statements to
> specifically catch AttributeError instead of any exception.
> I hope there aren't any other types of exceptions that can be raised by
> that getattr snippet.
And now, I know how to catch a specific exception;)
Thanks for fixing it.
> pootle_gnuprojects_no_detect.patch also has a catch-all except.
> Do you know of a specific exception that would be triggered in that
> block of code?
I think I did it for the same exception.
I suppose it was because not every project needs/has the 'treestyle'
attribute.
> I've committed the except clause as is now because any exception in
> there would just allow the current/previous code to be run as fallback.
> But we should consider specifying an explicit exception there.
>
> Friedel suggested that the autodetect code in hasgnufiles() should save
> the treestyle after detection.
> The method would then be slow only the first time it's run.
I remember I first implemented a cache for the treestyle.
IIRC, this was a sufficient speedup.
The only reason I can remember for switching to a configuration variable
is to support PO like vi.po, apt.po and vim.po (for the vi, apt or vim
software; not for Vietnamese and unknown languages).
> > I can provide some measurements for the speedups of
> > pootle_gnuprojects_no_detect.patch and pootle_no_autoload.patch if you
> > wish.
>
> That would be interesting to see :-)
Here are some data:
I used different patch combinations, and run the test on two project.
The tests are run twice. The second one is much faster thanks to the
Pootle's cache.
Projects:
=========
pootle debconf
files 126 59769
size (kB) 3450 601360
languages 65 87
(note: debconf uses a GNU style file tree, not pootle)
debconf uses a lot of very small PO files (usually something like 2 big
strings)
C1 (minimal configuration to have a Debian package, and avoid some
failures with some PO files - I'm not sure these failures still
exist, but I wanted to be safe and it should have no impact on
performances)
#pootle_mail_header.patch
pootle_continue_after_po_failure.patch
#pootle_get_pofiles_with_find.patch
#pootle_gnuprojects_no_detect.patch
#pootle_logos_prefs.patch
#pootle_typos.patch
debian_system_installation.patch
#pootle_no_autoload.patch
#pootle_ll_CC_languages.patch
#pootle_no_autoload_language.patch
C2
#pootle_mail_header.patch
pootle_continue_after_po_failure.patch
#pootle_get_pofiles_with_find.patch
pootle_gnuprojects_no_detect.patch
#pootle_logos_prefs.patch
#pootle_typos.patch
debian_system_installation.patch
#pootle_no_autoload.patch
#pootle_ll_CC_languages.patch
#pootle_no_autoload_language.patch
C3
#pootle_mail_header.patch
pootle_continue_after_po_failure.patch
pootle_get_pofiles_with_find.patch
pootle_gnuprojects_no_detect.patch
#pootle_logos_prefs.patch
#pootle_typos.patch
debian_system_installation.patch
#pootle_no_autoload.patch
#pootle_ll_CC_languages.patch
#pootle_no_autoload_language.patch
C4
#pootle_mail_header.patch
pootle_continue_after_po_failure.patch
pootle_get_pofiles_with_find.patch
pootle_gnuprojects_no_detect.patch
#pootle_logos_prefs.patch
#pootle_typos.patch
debian_system_installation.patch
pootle_no_autoload.patch
#pootle_ll_CC_languages.patch
#pootle_no_autoload_language.patch
C5 (debian configuration)
pootle_mail_header.patch
pootle_continue_after_po_failure.patch
pootle_get_pofiles_with_find.patch
pootle_gnuprojects_no_detect.patch
pootle_logos_prefs.patch
pootle_typos.patch
debian_system_installation.patch
pootle_no_autoload.patch
pootle_ll_CC_languages.patch
#pootle_no_autoload_language.patch
C5 introduce only patches which should have hardly no impact on
performances. SO it can be taken as another run of C4.
C6
#pootle_mail_header.patch
pootle_continue_after_po_failure.patch
#pootle_get_pofiles_with_find.patch
#pootle_gnuprojects_no_detect.patch
#pootle_logos_prefs.patch
#pootle_typos.patch
debian_system_installation.patch
pootle_no_autoload.patch
#pootle_ll_CC_languages.patch
#pootle_no_autoload_language.patch
pootle C1 C2 C3 C4 C5 C6
RUN1
mem N.A. 18404 18404 16520 16784 16524
time 0:41.36 0:04.86 0:02.68 0:03.07 0:02.95 0:02.55
RUN2
mem N.A. 151252 151016 22728 22728 23840
time N.A. 0:02.19 0:00.65 0:01.32 0:00.58 0:00.47
debconf C1 C2 C3 C4 C5 C6
RUN1
mem N.A. 151040 149628 21744 21496 22416
time >1:02:58 28:44.85 9:17.26 0:22.17 0:28.29 26:22.19
RUN2
mem N.A. 151252 152148 23876 23860 25008
time N.A. 0:01.32 0:01.45 0:00.67 0:01.15 4:08.24
(Some values are not available because I did not measure the memory on C1,
and I killed the script after one hour)
I've never been patient enough to run C1 on debconf (> 4 hours IIRC)
The difference between C1 and C2 should be much bigger on debconf than on
pootle because debconf has a GNU style file tree.
So debconf on C1 would take more than 10x30 minutes.
My file system is quite slow, which could also explain why debconf, which
has a lot of files, takes a long long time to run.
It could be interesting to keep the index pages to compare the various
run.
I will try to do that this week-end.
Another interesting benchmark is to measure the time and memory needed to
display
http://localhost:8080/fr/debconf/ and http://localhost:8080/fr/pootle/
I will do it after finishing pootle_no_autoload_language.patch
Kind Regards,
--
Nekral
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Translate-pootle mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/translate-pootle