add the Smart::Comments perl module to Koha, a good idea?
hiya Devs i've secretly wanted Smart::Comments to replace Data::Dumper as the preferred debug tool of Koha (why you ask?, because its heaps more useful than Data::Dumper!!! ) what do other people think? i think i'm gonna send a patch to add the S::C module as a Koha dependency, a good idea? Mason
That's pretty slick. I'd have no objection to adding it in. I don't think we should slash Data::Dumper simply because there are many places it is currently used. We could work toward eliminating it, though. Kind Regards, Chris 2012/1/20 Mason James <mtj@kohaaloha.com>
hiya Devs
i've secretly wanted Smart::Comments to replace Data::Dumper as the preferred debug tool of Koha
(why you ask?, because its heaps more useful than Data::Dumper!!! )
what do other people think?
i think i'm gonna send a patch to add the S::C module as a Koha dependency, a good idea?
Mason
_______________________________________________ Koha-devel mailing list Koha-devel@lists.koha-community.org http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
On Fri, Jan 20, 2012 at 09:02:58AM -0500, Chris Nighswonger wrote:
That's pretty slick. I'd have no objection to adding it in. I don't think we should slash Data::Dumper simply because there are many places it is currently used. We could work toward eliminating it, though.
Data::Dumper is a dependency for Smart::Comments so you need it anyhow Colin -- Colin Campbell Chief Software Engineer, PTFS Europe Limited Content Management and Library Solutions +44 (0) 800 756 6803 (phone) +44 (0) 7759 633626 (mobile) colin.campbell@ptfs-europe.com skype: colin_campbell2 http://www.ptfs-europe.com
Hi, On Jan 20, 2012, at 9:02 AM, Chris Nighswonger wrote:
That's pretty slick. I'd have no objection to adding it in. I don't think we should slash Data::Dumper simply because there are many places it is currently used. We could work toward eliminating it, though.
Data::Dumper isn't just a debug tool, though -- more broadly, it's a way of serializing Perl data structures. Not the only way, of course -- we've already got YAML and JSON modules as dependencies that can serve the same purpose, but since Data::Dumper is also a core module, I don't think making a point of eliminating its use would gain us much. Of course, it doesn't hurt to continually evaluate usage of Koha's many Perl modules. Regards, Galen -- Galen Charlton Director of Support and Implementation Equinox Software, Inc. / The Open Source Experts email: gmc@esilibrary.com direct: +1 770-709-5581 cell: +1 404-984-4366 skype: gmcharlt web: http://www.esilibrary.com/ Supporting Koha and Evergreen: http://koha-community.org & http://evergreen-ils.org
On Fri, Jan 20, 2012 at 9:55 AM, Galen Charlton <gmc@esilibrary.com> wrote:
Hi,
That's pretty slick. I'd have no objection to adding it in. I don't
On Jan 20, 2012, at 9:02 AM, Chris Nighswonger wrote: think we should slash Data::Dumper simply because there are many places it is currently used. We could work toward eliminating it, though.
Data::Dumper isn't just a debug tool, though -- more broadly, it's a way of serializing Perl data structures. Not the only way, of course -- we've already got YAML and JSON modules as dependencies that can serve the same purpose, but since Data::Dumper is also a core module, I don't think making a point of eliminating its use would gain us much. Of course, it doesn't hurt to continually evaluate usage of Koha's many Perl modules.
And there is a nagging half-memory which tells me we use it for things other than debugging already... Kind Regards, Chris
Chris, 2012/1/20 Chris Nighswonger <cnighswonger@foundations.edu>
And there is a nagging half-memory which tells me we use it for things other than debugging already...
I think Data::Dumper is used for the logs. That is something we would not want to lose. Regards, Jared -- Jared Camins-Esakov Bibliographer, C & P Bibliography Services, LLC (phone) +1 (917) 727-3445 (e-mail) jcamins@cpbibliography.com (web) http://www.cpbibliography.com/
Hi, On Jan 20, 2012, at 2:59 AM, Mason James wrote:
i think i'm gonna send a patch to add the S::C module as a Koha dependency, a good idea?
As an optional dependency, maybe. But there's nothing stopping anybody from using it for their debugging now, right? Smart::Comments is a source filter -- and consequently may cause a modest but measurable performance hit if it were enabled across the board -- and some cursory Googling suggests that it may not have played well with mod_perl in the past. I don't know, and haven't yet tested, whether that's still the case, but I do think that should be checked before such a patch is accepted. Thinking aloud, perhaps (for Debian and friends) maybe it belongs as a dependency brought in by a new koha-dev-tools package? Regards, Galen -- Galen Charlton Director of Support and Implementation Equinox Software, Inc. / The Open Source Experts email: gmc@esilibrary.com direct: +1 770-709-5581 cell: +1 404-984-4366 skype: gmcharlt web: http://www.esilibrary.com/ Supporting Koha and Evergreen: http://koha-community.org & http://evergreen-ils.org
On 2012-01-21, at 3:48 AM, Galen Charlton wrote:
Hi,
On Jan 20, 2012, at 2:59 AM, Mason James wrote:
i think i'm gonna send a patch to add the S::C module as a Koha dependency, a good idea?
As an optional dependency, maybe. But there's nothing stopping anybody from using it for their debugging now, right?
Smart::Comments is a source filter -- and consequently may cause a modest but measurable performance hit if it were enabled across the board -- and some cursory Googling suggests that it may not have played well with mod_perl in the past. I don't know, and haven't yet tested, whether that's still the case, but I do think that should be checked before such a patch is accepted.
Thinking aloud, perhaps (for Debian and friends) maybe it belongs as a dependency brought in by a new koha-dev-tools package?
Regards,
Galen
cool, thanks for the replies everyone :) so, lets use both Smart::Comments and Data::Dumper hmmm, shall we start wrapping the loading of Koha debug modules in a 'if ($DEBUG) {use Smart::Comments}' type code block - as a performance tweak? would that work?
* Mason James (mtj@kohaaloha.com) wrote:
On 2012-01-21, at 3:48 AM, Galen Charlton wrote:
Hi,
On Jan 20, 2012, at 2:59 AM, Mason James wrote:
i think i'm gonna send a patch to add the S::C module as a Koha dependency, a good idea?
As an optional dependency, maybe. But there's nothing stopping anybody from using it for their debugging now, right?
Smart::Comments is a source filter -- and consequently may cause a modest but measurable performance hit if it were enabled across the board -- and some cursory Googling suggests that it may not have played well with mod_perl in the past. I don't know, and haven't yet tested, whether that's still the case, but I do think that should be checked before such a patch is accepted.
Thinking aloud, perhaps (for Debian and friends) maybe it belongs as a dependency brought in by a new koha-dev-tools package?
Regards,
Galen
cool, thanks for the replies everyone :)
so, lets use both Smart::Comments and Data::Dumper
hmmm, shall we start wrapping the loading of Koha debug modules in a 'if ($DEBUG) {use Smart::Comments}' type code block - as a performance tweak?
would that work?
No because the use is called anyway, you can conditionally use a use call. You would need to do require and import. Chris
_______________________________________________ Koha-devel mailing list Koha-devel@lists.koha-community.org http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
-- Chris Cormack Catalyst IT Ltd. +64 4 803 2238 PO Box 11-053, Manners St, Wellington 6142, New Zealand
Hi, On Jan 21, 2012, at 11:40 PM, Chris Cormack wrote:
* Mason James (mtj@kohaaloha.com) wrote:
hmmm, shall we start wrapping the loading of Koha debug modules in a 'if ($DEBUG) {use Smart::Comments}' type code block - as a performance tweak?
would that work?
No because the use is called anyway, you can conditionally use a use call. You would need to do require and import.
_Cannot_ conditionally use a use call, I assume. Mason: "use Foo;" is equivalent to BEGIN { require Foo; import Foo; }; The implicit BEGIN block is why one can put a use call anywhere in the source file, including after code that makes use of the module one is use'ing. Regards, Galen -- Galen Charlton Director of Support and Implementation Equinox Software, Inc. / The Open Source Experts email: gmc@esilibrary.com direct: +1 770-709-5581 cell: +1 404-984-4366 skype: gmcharlt web: http://www.esilibrary.com/ Supporting Koha and Evergreen: http://koha-community.org & http://evergreen-ils.org
On 2012-01-23, at 10:40 AM, Galen Charlton wrote:
Hi,
On Jan 21, 2012, at 11:40 PM, Chris Cormack wrote:
* Mason James (mtj@kohaaloha.com) wrote:
hmmm, shall we start wrapping the loading of Koha debug modules in a 'if ($DEBUG) {use Smart::Comments}' type code block - as a performance tweak?
would that work?
No because the use is called anyway, you can conditionally use a use call. You would need to do require and import.
_Cannot_ conditionally use a use call, I assume.
Mason: "use Foo;" is equivalent to
BEGIN { require Foo; import Foo; };
The implicit BEGIN block is why one can put a use call anywhere in the source file, including after code that makes use of the module one is use'ing.
aaah, yep - thats sounds very familiar to me :p hmmm, would using 'Module::Load::Conditional' be a nice clean way to conditionally load debug modules when needed? http://search.cpan.org/dist/Module-Load-Conditional/lib/Module/Load/Conditio...
On 2012-01-21, at 3:48 AM, Galen Charlton wrote:
Hi,
On Jan 20, 2012, at 2:59 AM, Mason James wrote:
i think i'm gonna send a patch to add the S::C module as a Koha dependency, a good idea?
As an optional dependency, maybe. But there's nothing stopping anybody from using it for their debugging now, right?
Smart::Comments is a source filter -- and consequently may cause a modest but measurable performance hit if it were enabled across the board -- and some cursory Googling suggests that it may not have played well with mod_perl in the past. I don't know, and haven't yet tested, whether that's still the case, but I do think that should be checked before such a patch is accepted.
i was curious and did a google-search too... looks like the thread below, is the only mention of smart::comments not behaving on mod-perl http://www.perlmonks.org/?node_id=850248 and in the same thread, someone else challenges that idea, saying s::c looks mod-perl clean
Thinking aloud, perhaps (for Debian and friends) maybe it belongs as a dependency brought in by a new koha-dev-tools package?
so, if smart-comments works on mod-perl and we can use a system where the module is loaded only when $DBUG is set - it's a useful addition to Koha debugging
Regards,
Galen -- Galen Charlton Director of Support and Implementation Equinox Software, Inc. / The Open Source Experts email: gmc@esilibrary.com direct: +1 770-709-5581 cell: +1 404-984-4366 skype: gmcharlt web: http://www.esilibrary.com/ Supporting Koha and Evergreen: http://koha-community.org & http://evergreen-ils.org
cheers, Mason -- KohaAloha, NZ
participants (6)
-
Chris Cormack -
Chris Nighswonger -
Colin Campbell -
Galen Charlton -
Jared Camins-Esakov -
Mason James