in reply to Re: When does it make sense to preload modules when starting Starman?
in thread When does it make sense to preload modules when starting Starman?
"... modules take a long time to initialize..."
Ja, ja or yes sure as you like. This is what common sense tells us.
But consider this funny little study i recently posted:
# app.psgi use strict; use warnings; use Plack::Request; use Plack::App::URLMap; use JSON::Tiny qw(encode_json); my $slash = sub { my $env = shift; my $json = encode_json {nose => 'cuke'}; my $status = 200; my $request = Plack::Request->new($env); my $headers = [ 'Content-Type' => 'application/json', 'Content-Length' => length $json, ]; my $body = [ $json ]; [ $status, $headers, $body ]; }; my $urlmap = Plack::App::URLMap->new; $urlmap->mount( "/" => $slash ); my $app = $urlmap->to_app; __END__
Preloading the Plack stuff? JSON::Tiny might be cheap but who knows.
It is really difficult to find answers for these questions.
And what if i daemonize Starman? The switches for this task are confusing.
Thanks for your kind reply and best regards, Karl.
P.S.: I asked the author. Probably he will enlight us.
«The Crux of the Biscuit is the Apostrophe»
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: When does it make sense to preload modules when starting Starman?
by LanX (Saint) on Oct 28, 2021 at 11:29 UTC | |
by karlgoethebier (Abbot) on Oct 28, 2021 at 13:56 UTC | |
by LanX (Saint) on Oct 28, 2021 at 13:59 UTC | |
by karlgoethebier (Abbot) on Oct 28, 2021 at 19:00 UTC | |
by perlfan (Parson) on Oct 29, 2021 at 08:39 UTC | |
by karlgoethebier (Abbot) on Oct 30, 2021 at 07:45 UTC |