►
Description
Don't miss out! Join us at our upcoming event: KubeCon + CloudNativeCon Europe in Amsterdam, The Netherlands from 18 - 21 April, 2023. Learn more at https://kubecon.io The conference features presentations from developers and end users of Kubernetes, Prometheus, Envoy, and all of the other CNCF-hosted projects.
A
Let
me
start
with
the
disclaimer
first.
This
talk
is
going
to
be
about
Johnny
that
we
had
as
a
company
adding
support
for
running
in
a
serious
environment
in
our
node.js
debugger.
This
is
not
and
I
repeat.
This
is
not
a
fully
comprehensive
guide
or
to-do
list
that
will
guide
you
to
how
to
make
the
transitions
for
your
application
yourself.
A
A
Your
users
just
add
you
as
dependency
for
your
serverless
Handler
and
call
you
at
the
start
of
the
end
point.
So
let's
look
at
a
simple
example.
Let's
say
your
package
is
called
logic,
so
previously
your
users
call
logic.stout
at
the
start
of
a
development
function
and
to
make
that
transition
to
a
serverless
app.
A
A
A
A
A
It
is
also
was
not
the
same.
That's
not
all
pain
points
are
equal
and
some
are
less
difficult
than
others
and
some
harder.
For
example,
if
you
decide
to
use
a
Docker
image
as
your
Lambda
endpoint,
you
can
increase
the
size
of
your
app
from
200
megabytes
to
10
gigabytes,
simply
by
using
Docker
image.
Instead,
our
biggest
challenge
was
the
challenge
of
having
big
cold
start
times
to
those
of
you
not
familiar
with
the
damn
cold
start.
A
A
If
you
are
the
most
senior
developer,
you
might
find
some
Concepts
in
the
stock
as
obvious,
but
I
hope
you'll
still
learn
something
new.
So
before
we
actually
begin
our
journey,
let's
briefly,
very
briefly,
go
over
Source
Maps
themselves.
What
are
they
exactly
so
in
a
nutshell,
JavaScript
wall
is
a
mess.
You
need
to
support
many
different
runtime
environments.
You've
got
both
node.js
and
you've
got
browsers,
and
even
when
running
on
browsers,
you
need
to
support
all
different
kinds
of
browsers.
A
A
A
A
A
Let's
take
a
look
at
a
simple
example
over
here.
We
can
see
an
example:
Source
Maps
file
I
am
not
going
to
go
over
each
and
every
field.
Here,
let's
take
a
look
at
Several
of
them.
We've
got
a
versions
field
which
tell
us
which
source
Maps
version
we
are
using.
In
this
case,
three
we've
got
the
different
sources
that
compromise
the
file.
We've
got
the
names
of
different
elements,
but
the
most
important
one
here
is
the
mappings
field.
A
Now
I
know
for
most
of
you
guys,
it
looks
like
absolute
rubbish,
but
it
is
actually
a
compact
in
column
of
the
mapping
of
every
position
in
the
final
source
code,
the
vanilla
JavaScript
code
was
outputted
by
the
transpiler
and
back
to
our
original
source
code.
In
our
example,
it
was
our
typescript
code
and
when
you
actually
pass
this
encoding,
you
can
get
the
different
line.
Numbers
and
column
numbers
matching
each
position
in
the
code.
A
A
A
A
A
It
is
an
event
Loop
engine
and
it
is
very
fast
and
great.
Our
main
communication
with
V8
is
by
subscribing
to
an
event
and
passing
a
callback
that
will
handle
that
event.
Follow
that
scripts.
You
use
the
debugger
dot
scriptpost
event
to
get
notified
about
loaded,
Scripts,
pretty
simple
right
when
we
first
started
out
a
couple
years
ago,
when
a
script
was
loaded,
we
went
over
its
source
code.
We
looked
for
URLs
that
are
pointing
to
related
Source
Maps.
A
A
Think
how
much
IO
walk
we
are
doing
here.
Loading
the
source
files
only
to
look
for
the
salesman
bureaus
source
files
can
be
huge
and
we
are
spending
a
lot
of
time
going
over
each
line
in
them
and
looking
for
urls
a
short
while
later
we
found
out
that
one
of
the
parameters
to
the
Callback
of
script
post
is
actually
Source.
Maps
URL
that
exercises
from
loading
the
source
file
and
looking
for
levels
of
source
Maps
with
some
massive
and
I
mean
massive
performance
improvements.
A
Although
we
got
a
nice
performance
boost,
it
is
still
not
enough.
It
is
time
to
look
at
the
next
corporate
and
it
is
every
programmer's
worst
nightmare,
walking
too
hard
at
first,
when
we
only
supported
normal
server
apps.
We
loaded
each
script
at
the
start
of
the
program,
and
that
means
we
also
passed
the
source
maps
for
each
script
at
the
start
of
the
program.
A
Think,
for
example,
about
a
huge
app
with
tons
of
different
source
files,
there's
a
lot
of
source
modes
to
parse,
but
that
was
a
thread
of
we
did
at
the
time
between
having
one
big
spike
of
latency
at
the
start
of
the
app
or
having
smaller
most
product
latencies.
But
was
it
we
couldn't
be
entirely
predict.
A
A
A
A
Well.
Well,
at
a
final
point
now
so,
let's
Dive
In.
So
we
all
seen
massive
improvements
in
cold
start
times,
but
we
can
push
even
further
than
that.
We
believe
that
since
Souls
Maps
passing
is
our
biggest
time
consumer
we
can
still
improve
there.
I
mean
it
makes
a
lot
of
sense.
We
are
a
debugger
after
all,
Source.
My
passing
is
most
of
our
job.
A
A
But
you
probably
already
saw
this
coming.
The
main
idea
here
is
applicable
not
only
to
serverless
apps
I'm,
going
to
look
at
something
entirely
different
here
to
show
you
that
it
isn't
something
that
is
Javascript,
specific
or
maybe
serverless
specific,
because
I
think
this
idea
itself
is
very
easy
to
implement
in
your
code
and
might
result
in
huge
performance
gains,
mostly
in
your
serverless
apps,
but
sure
in
every
other
area
that
you
might
stumble
upon.
A
A
A
A
A
Just
as
a
side
note.
In
this
example,
we
are
using
the
default
hashmap
as
well
in
the
second
and
third
line,
the
default
being
random
state,
but
you
can
hop
on
to
creates.io
and
choose
a
different
hasher
for
your
code
as
well
so
over
here
we
can
see
we
called
random,
State,
column,
column,
U
and
then
initialized,
our
hashmap
with
hashmap
column,
colon
with
hashel,
with
our
hazard,
so
I
think
that
the
lesson
learned
here
is
to
not
be
afraid
to
tweak
the
defaults
to
something
that
better
suits
your
needs.
A
A
What
did
you
learn
in
our
journey?
There
is
a
lot
more
to
consider
When
developing
for
service
architecture
versus
the
standard
application.
Let's
look
back
at
the
previous
slide.
We
went
over
our
different
pain
points
called
star
times,
package
size
limits,
vendor
lock-in
and
all
sorts
of
stuff
like
that
also
cold
start,
can
help
a
lot
and
it
is
worth
noting.
A
You
should
always
keep
an
eye
out
for
optimization
options.
They
are
always
out
there
and
sometimes
they'll
how
to
do,
but
sometimes
they
are
just
waiting
for
you
to
do
them
and
that's
it.
For
me,
I
hope
you
had
a
great
time
joining
us
on
our
journey
and
that
you
have
learned
some
skills
and
ideas
that
you
can
utilize
when
doing
the
transition
yourself.