By the end of the post, you'll see that because most of our JS code
runs on highly optimized engines, performance and readability are
not mortal enemies. In fact, readable Javascript is frequently the
same as performant Javascript.
You may know that all numbers in JavaScript are 64 bit
double-precision floating point values. This is sometimes convenient
and it works pretty well as a default for novice programmers, who
are often confused by integer math, and rightfully so when 1 / 2 = 0. Unfortunately, it makes things slow. Doubles take a lot of
memory and floating point math is slower than integer math on
CPUs. It's also inconvenient if you want to port existing code to
JavaScript, because existing code usually expects to use integer
math.
Fortunately, there is a way to make JavaScript do integer math, and
it works remarkably well!
When you maintain a project, publishing new releases can quickly
become a chore, so naturally one tries to automate it as much as
possible.
One release step which is often automated is updating the
changelog. We already have git commit messages, so let's gather all
the messages since the last tag and "Voilà!" changelog entries for
the new version!
There is however a problem with this idea:
Git commit messages and changelogs do not have the same target audience.
The desert planet Arrakis, called Dune, has been destroyed. The
remnants of the Old Empire have been consumed by the violent
matriarchal cult known as the Honored Matres. Only one faction
remains a viable threat to their total conquest—the Bene Gesserit,
heirs to Dune’s power.
Under the leadership of Mother Superior Darwi Odrade, the Bene
Gesserit have colonized a green world on the planet Chapterhouse and
are turning it into a desert, mile by scorched mile. And once
they’ve mastered breeding sandworms, the Sisterhood will control the
production of the greatest commodity in the known galaxy—the spice
melange. But their true weapon remains a man who has lived countless
lifetimes—a man who served under the God Emperor Paul Muad’Dib....
In the evening I started in the sixth Dune Novel by Frank Herbert:
Chapterhouse:
Dune.
I'm a fan of the
unzip command line
utility that ships with macOS. I give it a .zip file and it unzips
it for me. No flags or arguments to remember (for my typical usages
anyway). Most importantly, I've fully internalized the unzip
command into muscle memory, probably because of its perfect
mnemonic.
When I was learning Java in college, I did not understand the use
for interfaces. You can't define functions inside an interface. You
can only declare them. You have to have a class implement the
interface to define it's functions and then use them. That's crazy!
Pretty worthless piece of crap I would think. I can just write my
classes and their functions normally. Why would I declare them in one
place and define in another. I don't even need to declare them. Just
write my functions normally in a class. It's totally redundant.
Many topics in cryptography on this blog so far, but not many basic
topics. This post is a crack at providing such an approach. With
luck, it should bring utility to unfamiliar folk, but also grins for
folk familiar with this art.
You may be aware of Nix or NixOS. Users love
it for being a superior tool for building, deploying, and managing
software. Yet, it is generally perceived as notoriously hard to
learn.
ecently I was asked to look into a case where an identical SQL
executed on the same database in two different ways resulted in two
quite different latencies: 133ms versus 750ms.
One was acceptable for the client, and the other one wasn't.
This guide is intended to aid advanced Go users in better
understanding their application costs by providing insights into the
Go garbage collector. It also provides guidance on how Go users may
use these insights to improve their applications' resource
utilization. It does not assume any knowledge of garbage collection,
but does assume familiarity with the Go programming language.
In this post, I'll walk you through building a heatmap using freely
available CSV and geospatial data. This post will make use of
Python, ClickHouse and
QGIS, a toolchain
that is both open source and free of charge.
In 1978 Japan's Ministry of Economy, Trade and
Industry
established the encoding that would later be known as JIS X 0208,
which still serves as an important reference for all Japanese
encodings. However, after the JIS standard was released people
noticed something strange - several of the added characters had no
obvious sources, and nobody could tell what they meant or how they
should be pronounced. Nobody was sure where they came from. These
are what came to be known as the ghost characters (幽霊文
字
).
A crucial feature of good software is clean code. Developers prefer
to work on applications if the code is easy to understand and
modify. Sometimes, the coding hastened to meet deadlines but
eventually causes delay since more bugs need fixing. Studies have
revealed that the time spent reading code compared to writing is
higher than 10:1. Hence, the need for clean code arises.
If you need to process a large JSON file in Python, you want:
Make sure you don’t use too much memory, so you don’t crash
half-way through.
Parse it as quickly as possible.
Ideally, make sure the data is actually valid up-front, with the
right structure, so you don’t blow up half-way through your
analysis.
You can put together solutions with multiple libraries, of
course. Or, you can use msgspec
a new library that offers schemas, fast parsing, and some neat
tricks to reduce memory usage, all in a single library.
In the evening I finished Heretics of
Dune
by Frank Herbert. I liked this book more than the previous one, God
Emperor of Dune, which was a bit boring. Heretics of Dune, on the
other hand, is action packed; a page turner.
Recently, I
posted
about how vpnkit, built with
MirageOS libraries, powers Docker
Desktop. Docker
Desktop enables users to build, share and run isolated,
containerised applications on either a Mac or Windows
environment. With millions of
users,
it's the most popular developer tool on the planet. Hence,
MirageOS networking libraries transparently handle the traffic of
millions of containers, simplifying many developers' experience
every day.
I’ve recently seen some really broad tables (hundreds of columns) in
a somewhat inefficiently structured database. Our PostgreSQL support
customer complained about strange runtime behavior which could not
be easily explained. To help other PostgreSQL users in this same
situation, I decided to reveal the secrets of a fairly common
performance problem many people don’t understand: Column order and
column access.
In this post we'll build a basic jq clone in Go. It will only be
able to pull a single path out of each object it reads. It won't be
able to do filters, mapping, etc.
A perennial question in the database world: should you prefer to
keep application logic closer to the database itself, in stored
procedures and triggers, or above the database in your application
code?
Postgres 15 beta 2 was
released
recently! I enjoy Beta season... reviewing and testing new features
is a fun diversion from daily tasks. This post takes a look at an
improvement to UNIQUE constraints on columns with NULL
values. While the
nuances of unique constraints are not as flashy as making sorts
faster
(that's exciting!), improving the database developer's control over
data quality is always a good benefit.