text
stringlengths 1
372
|
|---|
and receive responses to those messages.
|
however, you can’t receive unsolicited messages from the host platform.
|
as an example,
|
you can’t set up a long-lived firestore listener in a background isolate,
|
because firestore uses platform channels to push updates to flutter,
|
which are unsolicited.
|
you can, however, query firestore for a response in the background.
|
<topic_end>
|
<topic_start>
|
more information
|
for more information on isolates, check out the following resources:
|
<topic_end>
|
<topic_start>
|
performance FAQ
|
this page collects some frequently asked questions
|
about evaluating and debugging flutter’s performance.
|
<topic_end>
|
<topic_start>
|
more thoughts about performance
|
<topic_end>
|
<topic_start>
|
what is performance?
|
performance is a set of quantifiable properties of a performer.
|
in this context, performance isn’t the execution of an action itself;
|
it’s how well something or someone performs. therefore, we use the adjective
|
performant.
|
while the how well part can, in general, be described in natural languages,
|
in our limited scope, the focus is on something that is quantifiable as a real
|
number. real numbers include integers and 0/1 binaries as special cases.
|
natural language descriptions are still very important. for example, a news
|
article that heavily criticizes flutter’s performance by just using words
|
without any numbers (a quantifiable value) could still be meaningful, and it
|
could have great impacts. the limited scope is chosen only because of our
|
limited resources.
|
the required quantity to describe performance is often referred to as a
|
metric.
|
to navigate through countless performance issues and metrics, you can categorize
|
based on performers.
|
for example, most of the content on this website is about the flutter app
|
performance, where the performer is a flutter app. infra performance is also
|
important to flutter, where the performers are build bots and CI task runners:
|
they heavily affect how fast flutter can incorporate code changes, to improve
|
the app’s performance.
|
here, the scope was intentionally broadened to include performance issues other
|
than just app performance issues because they can share many tools regardless of
|
who the performers are. for example, flutter app performance and infra
|
performance might share the same dashboard and similar alert mechanisms.
|
broadening the scope also allows performers to be included that traditionally
|
are easy to ignore. document performance is such an example. the performer
|
could be an API doc of the SDK, and a metric could be: the percentage of readers
|
who find the API doc useful.
|
<topic_end>
|
<topic_start>
|
why is performance important?
|
answering this question is not only crucial for validating the work in
|
performance, but also for guiding the performance work in order to be more
|
useful. the answer to “why is performance important?” often is also the answer
|
to “how is performance useful?”
|
simply speaking, performance is important and useful because, in the scope,
|
performance must have quantifiable properties or metrics. this implies:
|
not that non-performance, or non-measurable issues or descriptions are not
|
important. they’re meant to highlight the scenarios where performance can be
|
more useful.
|
<topic_end>
|
<topic_start>
|
1. a performance report is easy to consume
|
performance metrics are numbers. reading a number is much easier than reading a
|
passage. for example, it probably takes an engineer 1 second to consume the
|
performance rating as a number from 1 to 5. it probably takes the same engineer
|
at least 1 minute to read the full, 500-word feedback summary.
|
if there are many numbers, it’s easy to summarize or visualize them for quick
|
consumption. for example, you can quickly consume millions of numbers by
|
looking at its histogram, average, quantiles, and so on. if a metric has a
|
history of thousands of data points, then you can easily plot a timeline to
|
read its trend.
|
on the other hand, having n number of 500-word texts almost guarantees an
|
n-time cost to consume those texts. it would be a daunting task to analyze
|
thousands of historical descriptions, each having 500 words.
|
<topic_end>
|
<topic_start>
|
2. performance has little ambiguity
|
another advantage of having performance as a set of numbers is its unambiguity.
|
when you want an animation to have a performance of 20 ms per frame or
|
50 fps, there’s little room for different interpretations about the numbers. on
|
the other hand, to describe the same animation in words, someone might call it
|
good, while someone else might complain that it’s bad. similarly, the same
|
word or phrase could be interpreted differently by different people. you might
|
interpret an OK frame rate to be 60 fps, while someone else might interpret it
|
to be 30 fps.
|
numbers can still be noisy. for example, the measured time per frame might
|
be a true computation time of this frame, plus a random amount of time (noise)
|
that CPU/GPU spends on some unrelated work. hence, the metric fluctuates.
|
nevertheless, there’s no ambiguity of what the number means. and, there are
|
also rigorous theory and testing tools to handle such noise. for example, you
|
could take multiple measurements to estimate the distribution of a random
|
variable, or you could take the average of many measurements to eliminate the
|
noise by the law of large numbers.
|
<topic_end>
|
<topic_start>
|
3. performance is comparable and convertible
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.