Hi, Le 10/02/2011 17:04, ambs a écrit :
On 10/02/2011 16:01, Oleg A. Mamontov wrote:
2. Explicitly call&MIME::Types::init early (before fork):
package Dancer::MIME; use strict; use warnings; use base 'Dancer::Object::Singleton'; use MIME::Types;
MIME::Types->init;
[...] Did you try both solutions? Personally I prefer the first one and I'm happy to prepare the patch on git.
Yes and preffer the first one too :) But drawback of this solution is loss of lazy initialization. On my iMac this is + ~30ms to Dancer startup.
Well, Dancer doesn't start that often.
But, sukria, what do you say? You're the boss :D
I also like that strategy. Dancer startup is not that bad and I think we can accept an extra ms in order to fix an issue. That's understandable Concerning MIME::Types though, I have another -unrelated- issue: MIME::Types brings 3 Test:: modules. We should really bug the author to make these deps dynamic, see what happens on a fresh install of Dancer, on a brand new perlbrew 5.12.2 : 2 3 4 5 6 7 8 Fetching http://search.cpan.org/CPAN/authors/id/S/SU/SUKRIA/Dancer-1.3003.tar.gz ... OK Fetching http://search.cpan.org/CPAN/authors/id/M/MI/MIYAGAWA/HTTP-Server-Simple-PSGI... ... OK Fetching http://search.cpan.org/CPAN/authors/id/J/JE/JESSE/HTTP-Server-Simple-0.43.ta... ... OK Fetching http://search.cpan.org/CPAN/authors/id/G/GE/GETTY/HTTP-Body-1.11.tar.gz ... OK Fetching http://search.cpan.org/CPAN/authors/id/R/RJ/RJBS/Test-Deep-0.108.tar.gz ... OK Fetching http://search.cpan.org/CPAN/authors/id/F/FD/FDALY/Test-Tester-0.107.tar.gz ... OK Fetching http://search.cpan.org/CPAN/authors/id/A/AD/ADAMK/Test-NoWarnings-1.02.tar.g... ... OK Fetching http://search.cpan.org/CPAN/authors/id/M/MA/MARKOV/MIME-Types-1.31.tar.gz ... OK So we have exactly 7 non-core deps under 5.12.2, with a MIME::Types updated this would be 4 (Test::Tester, Test::NoWarnings and Test::Deep are required by MIME;::Types, not Dancer itself). Of course if we decide to rewrite MIME::Types the problem disappears, but it might be a bit overkill (and source of new Dancer-unrelated bugs)... Regards, PS: I'm the one who started the project, that's true, but Dancer now lives on his own, thanks to its awesome community and dedicated core-team members, so "boss" doesn't mean anything ;-) My ego likes the term "architect", though, I must say :D -- Alexis Sukrieh