text
stringlengths
1
372
performance numbers not only have unambiguous meanings, but they also have
unambiguous comparisons. for example, there’s no doubt that 5 is greater than 4.
on the other hand, it might be subjective to figure out whether excellent is
better or worse than superb. similarly, could you figure out whether epic is
better than legendary? actually, the phrase strongly exceeds expectations
could be better than superb in someone’s interpretation. it only becomes
unambiguous and comparable after a definition that maps strongly exceeds
expectations to 4 and superb to 5.
numbers are also easily convertible using formulas and functions. for example,
60 fps can be converted to 16.67 ms per frame. a frame’s rendering
time x (ms) can be converted to a binary indicator
isSmooth = [x <= 16] = (x <= 16 ? 1 :0). such conversion can be compounded or
chained, so you can get a large variety of quantities using a single
measurement without any added noise or ambiguity. the converted quantity can
then be used for further comparisons and consumption. such conversions are
almost impossible if you’re dealing with natural languages.
<topic_end>
<topic_start>
4. performance is fair
if issues rely on verbose words to be discovered, then an unfair advantage is
given to people who are more verbose (more willing to chat or write) or those
who are closer to the development team, who have a larger bandwidth and lower
cost for chatting or face-to-face meetings.
by having the same metrics to detect problems no matter how far away or how
silent the users are, we can treat all issues fairly. that, in turn,
allows us to focus on the right issues that have greater impact.
<topic_end>
<topic_start>
how to make performance useful
the following summarizes the 4 points discussed here, from a slightly different
perspective:
make performance metrics easy to consume. do not overwhelm the readers with a
lot of numbers (or words). if there are many numbers, then try to summarize
them into a smaller set of numbers (for example, summarize many numbers into
a single average number). only notify readers when the numbers change
significantly (for example, automatic alerts on spikes or regressions).
make performance metrics as unambiguous as possible. define the unit that the
number is using. precisely describe how the number is measured. make the
number easily reproducible. when there’s a lot of noise, try to show the full
distribution, or eliminate the noise as much as possible by aggregating many
noisy measurements.
make it easy to compare performance. for example, provide a timeline to
compare the current version with the old version. provide ways and tools to
convert one metric to another. for example, if we can convert both memory
increase and fps drops into the number of users dropped or revenue lost in
dollars, then we can compare them and make an informed trade-off.
make performance metrics monitor a population that is as wide as possible,
so no one is left behind.
<topic_end>
<topic_start>
obfuscate dart code
<topic_end>
<topic_start>
what is code obfuscation?
code obfuscation is the process of modifying an
app’s binary to make it harder for humans to understand.
obfuscation hides function and class names in your
compiled dart code, replacing each symbol with
another symbol, making it difficult for an attacker
to reverse engineer your proprietary app.
flutter’s code obfuscation works
only on a release build.
<topic_end>
<topic_start>
limitations
note that obfuscating your code does not
encrypt resources nor does it protect against
reverse engineering.
it only renames symbols with more obscure names.
info
it is a poor security practice to
store secrets in an app.
<topic_end>
<topic_start>
supported targets
the following build targets
support the obfuscation process
described on this page:
info
web apps don’t support obfuscation.
a web app can be minified, which provides a similar result.
when you build a release version of a flutter web app,
the web compiler minifies the app. to learn more,
see build and release a web app.
<topic_end>
<topic_start>
obfuscate your app
to obfuscate your app, use the flutter build command
in release mode
with the --obfuscate and --split-debug-info options.
the --split-debug-info option specifies the directory
where flutter outputs debug files.
in the case of obfuscation, it outputs a symbol map.
for example:
once you’ve obfuscated your binary, save
the symbols file. you need this if you later
want to de-obfuscate a stack trace.
lightbulb tip
the --split-debug-info option can also be used without --obfuscate
to extract dart program symbols, reducing code size.