[Koha-bugs] [Bug 25078] Gracefully stop updatedatabase/installer when a database change cannot be applied

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Mon Feb 22 16:14:54 CET 2021


https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25078

--- Comment #30 from Julian Maurice <julian.maurice at biblibre.com> ---
(In reply to Julian Maurice from comment #29)
> About the performance of directory listing, I ran a small test:
> 
> % mktemp -d
> /tmp/tmp.t2Pdul9xNn
> 
> % grep 'DBversion =' installer/data/mysql/updatedatabase.pl | wc -l
> 1240  # That is the number of DB updates since 3.0
> 
> % for i in $(seq 1 1240); do touch /tmp/tmp.t2Pdul9xNn/$(openssl rand -hex
> 32); done
> 
> % perl -MTime::HiRes=tv_interval,gettimeofday -E 'my $t0 = [gettimeofday];
> opendir(my $dh, $ARVG[0]); my @names; foreach my $fname (sort readdir($dh))
> { push @names, $fname; } closedir($dh); my $elapsed = tv_interval($t0); say
> 1000*1000*$elapsed . "µs";' /tmp/tmp.t2Pdul9xNn/
> 25µs
> 
> I ran it several times and the result is always between 10µs and 50µs, so...
> I think there are better things to worry about.

Oops. My bad... perl did not warn about the typo (ARVG vs ARGV). I should learn
to use -w more
So the results are more between 1ms and 4ms :) Maybe some caching would be
useful after all

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list