speed

When you have Flutter app performance problems, try Profile Mode alvin September 25, 2019 - 4:35pm

Today I learned that for several reasons, Flutter Debug mode may be significantly slower than Production mode. As just one reason, Debug mode is compiled using JIT while Production mode uses AOT. You can read more about the reasons on the Flutter UI Performance page.

A very important note on that page is that if you’re using a real hardware device (as opposed to an emulator), you can run your code in Profile mode like this:

A correct Flutter FutureBuilder example (for SharedPreferences, REST services, and database access) alvin September 18, 2019 - 7:20pm

At the time of this writing (September 19, 2019), there’s a lot of bad information in books and on the internet about how to use a Flutter FutureBuilder. That bad information caused me to waste a lot of time over the last two days. I don’t have time today to explain everything, but in short, here’s a technically correct FutureBuilder example:

Notes on how to use GraalVM profile-guided optimizations alvin July 30, 2019 - 3:05pm

As a brief note today, I found that GraalVM was actually making one of my Scala/Java/JVM applications slower, so with the help of Thomas Wuerthinger at Oracle, I learned a little bit about how to use the GraalVM profile-guided optimizations.

Five good ways (and two bad ways) to read large text files with Scala alvin July 28, 2019 - 5:58pm

I’m working on a small project to parse large Apache access log files, with the file this week weighing in at 9.2 GB and 33,444,922 lines. So I gave myself 90 minutes to try a few different ways to write a simple “line count” program in Scala. (Not my final goal, but something I could use to measure file-reading speed without applying my algorithm.)

Good design: Quantity leads to quality (and iteration speed is vital)

When I saw this tweet this morning:

[DOG MAGICIAN] think of a color, any color ... is it ... gray?

[OTHER DOG] oh my GOD

I knew that I loved the joke, but I didn’t like the presentation. I wanted to put the joke on Facebook, but I know that people like images more than they like text, so I made a second cup of coffee and began putting the text on an image.

GraalVM native executables can run faster than Scala/Java/JVM applications, with much less memory consumption

In two small tests where GraalVM was able to create a native executable, the native executable ran significantly faster than the equivalent Scala/Java code running with the Java 8 JVM, and also reduced RAM consumption by a whopping 98% in a long-running example. On the negative side, GraalVM currently doesn’t seem to work with Swing applications.

Performance is important to acquiring and retaining customers.

I used to use wunderground.com all the time. Then, over time, I noticed that it kept getting slower and slower. Out of frustration I looked around for other good weather websites. Today I use accuweather.com.

On the web and with apps, performance — or lack of performance — is important to acquiring and retaining customers.

Bloop’s compiler performance is ~29% faster than SBT (on at least one project) alvin March 20, 2019 - 8:42pm

I had read that Bloop was faster than Scala compiler tools like scalac and fsc, so I wondered if it was faster than SBT, and if so, how much faster. So I downloaded Eric Torreborre’s specs2 source code, which has 880 source code files, and compiled the entire project with both SBT and Bloop.

SBT performance

To test SBT’s speed, I ran all the commands from inside the SBT command prompt, which I usually do anyway to avoid the SBT/JVM startup lag time. I also ran clean and compile several times before recording SBT’s speed, because I thought that would be a better reflection of real-world usage and performance. I ran the tests four times, and the average time with SBT was 49 seconds, and that was very consistent, always coming in between 48 and 50 seconds.

Bloop performance

Triplequote: A Guide to Amazon EC2 instance types alvin March 10, 2019 - 11:27am

The people at Triplequote looked at the performance of Scala compilers on different Amazon EC2 instance types in an effort to answer the question, “What is the (cloud) cost per build?”