Re: [Catalyst] Alternatives to Catalyst ?

2010-04-29 Thread Oleg Pronin
1) param is called often several times (in auto/end etc)
2) The question is not about params, but about accessors speed at all.
If all acessors were XSAccessor for example (catalyst makes a lot of
calls -stack/action/dispatcher , etc internally during request), then
your overall speed would be 600/s i think)
3) The question is also in approach to programming.
Why someone writes
$c-req-...
$c-req-...
$c-req-...
If you know that $c-req is not a fast accessor why do you call it
several times?

Is it hard to write  ?
my $req = $c-req;
$req-
$req-
...

Maybe it is not the bottleneck, but how many places do we have
like this that are not a bottleneck ? maybe the sum of all these
mini mistakes is the bottleneck ?

2010/4/28 Андрей П. Ковбович akovbov...@gmail.com:
 I was curious about what the big deal is raised, so spent a short test.

 *** Mojo *** (Alternative to Catalyst)
 timethese(-1, {
    param   = sub { $tx-req-param('lang') },
    params  = sub { $tx-req-params-param('lang') },
 });

 Benchmark: running param, params for at least 1 CPU seconds...
     param:  1 wallclock secs ( 1.07 usr +  0.00 sys =  1.07 CPU) @
 13397.20/s (n=14335)
    params:  1 wallclock secs ( 1.08 usr +  0.00 sys =  1.08 CPU) @
 8295.37/s (n=8959)

 *** Cat ***
 timethese(-1, {
    param  = sub { $c-req-param('lang') },
    params = sub { $c-req-params-{'lang'} },
 });

 Benchmark: running param, params for at least 1 CPU seconds...
     param:  1 wallclock secs ( 1.06 usr +  0.01 sys =  1.07 CPU) @
 30918.69/s (n=33083)
    params:  1 wallclock secs ( 1.07 usr +  0.01 sys =  1.08 CPU) @
 79643.52/s (n=86015)

 My Сat app can handle about 400req/s, at the same time accessor's
 access time is about  80K req/s, so if we imagine that we have not
 made a single call to $req-param, in that case app will handle
 402req/s. Show me the idiot who will try to optimize all the code for
 such trifles?

 ___
 List: Catalyst@lists.scsys.co.uk
 Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
 Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
 Dev site: http://dev.catalyst.perl.org/


___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] Alternatives to Catalyst ?

2010-04-29 Thread Mark Blackman
On 29 Apr 2010, at 10:06, Oleg Pronin wrote:
 
Maybe it is not the bottleneck, but how many places do we have
 like this that are not a bottleneck ? maybe the sum of all these
 mini mistakes is the bottleneck ?

Do the profiling, answer the maybe question.

- Mark


___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] Alternatives to Catalyst ?

2010-04-29 Thread Kieren Diment
On 29/04/2010, at 7:06 PM, Oleg Pronin wrote:

 [...]
Maybe it is not the bottleneck, but how many places do we have
 like this that are not a bottleneck ? maybe the sum of all these
 mini mistakes is the bottleneck ?

I've done some research on this topic, not from a computer science POV, but 
from the business end.  Of the popular web frameworks, Catalyst clearly runs 
some extremely popular websites, in a variety of sectors.  If the 
micro-bottlenecks were a problem for achieving scale, then Catalyst would not 
be usable for these entities.  Catalyst hits the sweet spot for lone coders 
like me, who use it to manage some kinds of messy research data (e.g. 
http://github.com/singingfish/Text-TranscriptMiner-Web) to mainstream content 
providers like the BBC, entities in the adult industry (always bandwidth hogs) 
and social media providers. In both cases it's the speed of the development 
cycle, and the ease with which it's possible to optimise around pain points on 
a case by case basis that is the main benefit.

So I'm really don't think your argument has substance.
___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] Alternatives to Catalyst ?

2010-04-29 Thread Carl Johnstone
Oleg Pronin wrote:
 Maybe it is not the bottleneck, but how many places do we have
 like this that are not a bottleneck ? maybe the sum of all these
 mini mistakes is the bottleneck ?

NYTProf profile or it didn't happen :-)

Carl


___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] Alternatives to Catalyst ?

2010-04-29 Thread Matija Grabnar

Carl Johnstone wrote:

NYTProf profile or it didn't happen :-)
  
Is there any best practices or hints page on how to use Catalyst and 
NYTprof?  I haven't used it before and I wonder if people include it 
into a running catalyst application (and then periodically review 
results in some way) or if they include it only into a 
just-for-profiling server which then runs a synthetic load? Or something 
in between?


I've had some problems with a catalyst application lately, but it turned 
out that it was caused by the FCGI servers being swapped out: no ammount 
of tweaking my code would have solved it, all it took was an extra 
$10/month for another 256M RAM.


___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] Alternatives to Catalyst ?

2010-04-29 Thread Stuart Watt
I was kind of hoping this thread would get to more helpful issues. It 
did, and thanks.


It's hard for us to profile a running application, for several reasons. 
(1) there is a web server in the way, and (2) the storage requirements 
(and to some extent performance) are a hit. Also, a management 
requirement was obfuscation that turns off debugging hooks needed for 
NYTProf, so our production code cannot really be profiled. However, we 
do audit mean response times for each view, and I have a few bits of 
charting code in R that allow us to report on it.


We actually run a test script that models a proper workflow. This 
happened because my colleagues require an old Perl tool webinject for 
QA. I ripped the back off webinject,. stuck Catalyst::Test in its place, 
and then run NYTProf on the whole thing. That way we have files that 
script a fairly realistic set of requests, and we can profile the whole 
bunch. Our requests vary a lot, with many simple ones and a few *really* 
complex ones, so I've used scales on charts that handle the long tail. 
As a side note, the Perl in webinject was somewhat hacky non-modern - 
I'd love a tool as good as JMeter.


Thinking about it, if you can live with the Java interface, JMeter 
rocks. It is great at modelling large sets of users with randomised 
request times, and displaying how number of users affects response 
latency. For performance, I don't know of anything in the Perl world to 
touch it, but I'd love it if something did.


This actually evolved as we work on a problem that is distinctive to our 
app under VMware ESX. We use using it to benchmark against VMware 
Server, which runs 3-4 times as fast as VMware ESX at the application 
level. There are *many* small differences between the two, although the 
big hit seems to be MySQL memory access (of all things). Some kind of DB 
issue showed up well in NYTProf, but other testing was needed to go 
further. Even a tool like NYTProf will not guarantee you can find the 
problem, because it may not be in Perl, let alone your app.


--S
--
Stuart Watt
ARM Product Developer
Information Balance


Matija Grabnar wrote:

Carl Johnstone wrote:

NYTProf profile or it didn't happen :-)
  
Is there any best practices or hints page on how to use Catalyst and 
NYTprof?  I haven't used it before and I wonder if people include it 
into a running catalyst application (and then periodically review 
results in some way) or if they include it only into a 
just-for-profiling server which then runs a synthetic load? Or 
something in between?


I've had some problems with a catalyst application lately, but it 
turned out that it was caused by the FCGI servers being swapped out: 
no ammount of tweaking my code would have solved it, all it took was 
an extra $10/month for another 256M RAM.


___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: 
http://www.mail-archive.com/catalyst@lists.scsys.co.uk/

Dev site: http://dev.catalyst.perl.org/

--
This message was scanned by ESVA and is believed to be clean.
Click here to report this message as spam. 
http://antispam.infobal.com/cgi-bin/learn-msg.cgi?id=43BA02807E.D8421


___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


[Catalyst] Re: Alternatives to Catalyst ?

2010-04-29 Thread Aristotle Pagaltzis
* Oleg Pronin syber@gmail.com [2010-04-29 11:10]:
 Maybe it is not the bottleneck, but how many places do we have
 like this that are not a bottleneck ? maybe the sum of all
 these mini mistakes is the bottleneck ?

Maybe, maybe, maybe. Stop guessing. Profile the code in question.

Here is my experience – *experience*, not theory, and not dogma:

If you look at any non-trivial piece of code, and you guess where
the performance bottleneck in that code will be, you will ALWAYS
be wrong. This is not a figure of speech. I am not taking poetic
licence here. I very literally mean you will guess wrong EACH and
EVERY single time.

Furthermore my experience is that in almost any codebase, the
execution time is spent almost entirely in very few spots. If you
optimise any other part than those spots, even if you make it
500,000 times faster, the result will be virtually nil. You can
even make *every*thing faster, *except* the hotspots, and it will
still add up to almost no improvement.

This is why we don’t all still write assembly today.

(Which is actually a pity, and part of the reason why so much
code today is so slow. Not because the code isn’t written in
assembly, but because it’s not written by assembly programmers.)

Regards,
-- 
Aristotle Pagaltzis // http://plasmasturm.org/

___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


[Catalyst] Job posting!

2010-04-29 Thread Byron Young
Hey Catalyst / DBIC folks,

I am leaving my job and, thus, my position is becoming available!

The title is QA Tools Developer - you would be working on custom internal apps 
at Riverbed Technology, a network acceleration company in downtown San 
Francisco, CA.  Good company, good people, good location (IMHO).

A lot of the work is full-stack OO Perl web development using Catalyst and DBIC.

Experience with the following will give you a leg up (ordered from most to 
least desired):
- solid OO Perl background
- Catalyst / DBIx::Class
- Javascript
- managing web servers and MySQL databases
- Bugzilla maintenance and customization

They'll reimburse up to $5k for relocation.

If you're interested please send an email to Stan Russell at 
stan.russ...@riverbed.com, with your resume attached.

Good luck!

Byron

___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/