Entries for macias.infomacias.info2022-12-23T19:00:00+01:00Dispatching 3000 HTTPS requests/second on a $6 VM16718184002022-12-23T19:00:00+01:00<p>Sometimes I can see small peaks of visits to this blog, especially when a post
reaches sites like e.g. Reddit or
HackerNews. But the extra amount of load never spends a significant amount of server resources.
Thinking about that, a question came to my mind: how many requests/second would my blog be able to dispatch
with decent response times?</p>Performance comparison of Go functional stream libraries16699356002022-12-02T00:00:00+01:00<p>With the arrival of <a href="https://go.dev/doc/tutorial/generics">Generics to Go 1.18</a>, a new programming model has arrived to
Go: functional stream processing. This post evaluates some current
libraries providing such functionality, and compares
the achieved performance in single-thread streams.</p>The engine behind this blog reached version 1.016675164002022-11-04T00:00:00+01:00<p>In 2017, I started to code the <a href="https://github.com/mariomac/goblog">engine that runs this blog</a> as
a learning exercise for the Go programming language, following the famous
<a href="https://go.dev/doc/articles/wiki/">Writing Web Applications</a> official tutorial.
That means that the quality of some parts of the code of this blog was poor, making it
difficult to understand (even for myself) and difficult to extend with new,
useful features that I had in mind to agilize even more my writing/publishing
workflows.</p>HTTPS support!16427854802022-01-21T18:18:00+01:00<p>After more than 4 years, I implemented HTTPS support for my blog. All
the old HTTP links will be redirected to their HTTPS equivalent.</p>An introduction to Go Kubernetes' informers16311168002021-09-08T18:00:00+02:00<p>This article shows you the tool that the <a href="https://pkg.go.dev/k8s.io/client-go/informers">Kubernetes Go client library</a>
provides to keep an updated in-memory snapshot of your cluster resources.</p>Go and WebAssembly (I): interacting with your browser JS API15842952002020-03-15T19:00:00+01:00<p>Golang provides the <code>syscall/js</code> experimental package to facilitate
the creation of browser-based applications without requiring any javascript
transpiler; just targeting your official Go compiler to WebAssembly and loading
the artifact in the browser. This blog post is a simple tutorial to allow you
setting up your Go WebAssembly project, as well as some basic functions to
allow your Go code interacting with JavaScript objects and functions.</p>KAConf: Kick-Ass Configuration system for your java applications (Tutorial)15807649202020-02-03T22:22:00+01:00<p>This blog post is a step-by-step guide that shows you the basic usage of
<a href="http://github.com/mariomac/kaconf">KAConf</a>, an Annotation-based configuration system
inspired in the wonderful <a href="http://spring.io">Spring Boot</a>, but simpler, lighter,
not so magic, and independent of any large framework, with no transitive
dependencies.</p>Enabling Java Reflection on GraalVM Ahead-of-Time compiler15782400002020-01-05T17:00:00+01:00<p>In my <a href="./201912201300_graal_aot.md">previous blog post</a> I evaluated the
feasibility of Java for lightweight system programming thanks to the
<a href="https://www.graalvm.org/">GraalVM</a>
native image generation tool. Despite the initial results look promising,
I felt disappointed when they
pointed me out that GraalVM does not support reflection by default (which IMHO
is a wonderful and powerful tool to enhance the expressiveness of our software
and to reduce boilerplate). However, you can actually configure the
ahead-of-time compiler to incorporate a user-provided reflection metadata.</p>Java JIT vs Java AOT vs Go for small, short-lived processes15768432002019-12-20T13:00:00+01:00<p>There is still a common belief about Java being slow (especially during the startup)
and memory-consuming, making it not being the first option for ephemeral service
instances, like containers. This blog post pretends to put some light on
those assertions, quantifying the impact of a last-generation JVM in a simple,
single-threaded, application. We compare the impact of the JVM measuring the
execution time and memory spent of a Java <a href="https://github.com/eugenp/tutorials/blob/master/algorithms-sorting">QuickSort implementation</a>,
comparing it with the execution of a native image generated with the modern
<a href="https://www.graalvm.org/">GraalVM</a> Ahead-Of-Time (AOT) compiler and the same
<a href="https://gist.github.com/mariomac/8518c01d44402244b2595360b867d60a">QuickSort implementation in Go</a>.</p>Code syntax highlighting available!15767505002019-12-19T11:15:00+01:00<p>After almost two years without updating this blog, I have changed the Markdown
processor from <a href="github.com/russross/blackfriday">Blackfriday</a> to
<a href="github.com/yuin/goldmark">Goldmark</a>, which includes an extension to highlight
the code syntax according to the <a href="https://github.com/alecthomas/chroma">Alec Thomas' Chroma engine and styles</a>.</p>