A new journal article: "Lessons for Interactive Theorem Proving Researchers from a Survey of Coq Users" https://t.co/rq406nNsjK with Ana de Almeida Borges, Annalí Casanueva Artís, @jrfaller Emilio Jesús Gallego Arias, Érik Martin-Dorel, @Palmskog, yt & @Zimm_i48
Join the #openscience movement in software engineering by reading our paper:
"A Conceptual Framework and Recommendations for Open Data and Artifacts in Empirical Software Engineering"
Yes, it is #openaccess
https://t.co/GXP6WfSQ3y
To use the Montreal subway, you tap a paper ticket against the turnstile and it opens. But how does it work? And how can the ticket be so cheap that it's disposable? I opened up the tiny NFC chip inside to find out more... 1/15
The fast JavaScript runtime Bun is much faster than Node.js 22 at decoding Base64 inputs. By much faster, I mean *several times* faster. But they both rely on the same underlying library (simdutf) for the actual decoding.
So what gives?
The problem is that Node.js needs to interact with v8, the underlying JavaScript engine (from Google)... and doing so is not trivial.
Before we can start decoding the string, we need to grab the string... so, in this instance, we call String::Value...
In turns, this allocates an array inside Node.js and asks v8 to copy the content to it...
In an ideal world, we would avoid the trouble entirely and just ask v8 to give us direct access to how it stores the string... and we try to do that if we can... but let me come back to it...
How bad can this be, right? Just a copy.
Well. Let us do some profiling...
So you see, the base64 decoding itself is about about 1/5 of the running time, but the copy takes half of it.
What is up with this CopyChars function? Well, it is mostly just a wrapper around the standard high level C++ function std::copy_n as far as I can tell. (see v8/src/utils/memcopy.h)
But we are copying for an 8-bit input to a 16-bit output... why is that? Base64 is pure ASCII... and v8 can store ASCII using 8-bit per character.
We get there before both IsExternalOneByte() and IsOneByte() are false (see node/src/node_buffer.cc)... We have fast paths for these cases. If IsExternalOneByte() is true, we just get the bytes and everything is great. Unfortunately, it does not always work.
So we have a v8 string that is really pure ASCII, but, seemingly, we can't tell that it is the case from Node.js, and so we have to convert it to UTF-16 needlessly, using a function that is maybe not very well optimized... and then we do the base64 decoding of an ASCII string from the UTF-16 input. It is not great.
To be fair, this is just one string, created as 'Buffer.alloc(size, "latin1").toString("base64")', basically the base64 encoded version of the string "latin1latin1latin1...". In actual applications, we might have better luck.
Yet. Yet. I am telling this complicated story for a reason.
The story illustrates why our software is slower than it should be. We have layers of abstractions to fight against. Sometimes you win, sometimes you lose.
These layers are there for a reason, but they are not free.
To make matters worse... these abstraction layers often thicken over time... and the friction goes up.
To be clear, I do not claim that the Node.js code is optimal. In fact, I know it can be better. But it is not trivial to make it go fast.
I sometimes hear people say... "well, it is C++ and C++ is hard". No. The C++ part is easy relatively speaking. The difficulty is at a higher level. It is not a matter of syntax. It is a matter of architecture.
📢#PhD defense from Florent Moriconi: "Improving Software Development Life Cycle using Data Driven Approaches". Goal is to better understand CI/CD logs, predict failures and localize root causes for automatic fix in software development. Joint work with @AmadeusITGroup
This is really important... we all know LLMs make mistakes...but when using LLM code completion one needs to be extra careful because they are EXCELLENT stochastic parrots.
Even when they are <wrong>, they SOUND <right> and thus can be the source of nasty errors.... 🧵
@JulienGossa Ceci dit, je prendrai plutôt avec des pincettes les résultats de cette "étude" dont je ne trouve la source nulle part et qui redirige le lecteur sur une méthode "miracle" vendue sous forme de livre sur Amazon par son auteur :-)
In May 1967, two computer scientists presented a paper about Simula 67, the first programming language to include abstract data types and classes: https://t.co/rx0l9Q4QTO
Version 3.2.0 of Alexandria3k, now available on @pypi, supports running performant and replicable relational queries on all PubMed citations. These can be used for systematic literature reviews, scientometric and bibliometric studies, and meta-analyses. https://t.co/PZnH1fl1Zr
@vcmusictheory There is one comment about this in the author's follow-up that you might want to look at: https://t.co/UAasxGCENW
But I agree that the hypersonic rate of publications in STEM makes peer review worse than it could be :-)
@BenevolWorkshop is coming to Namur next November (2024) so you can take this photo by yourself! I and @bvdose will take care of submissions, @anthonycleve of food and drinks, Xavier everything else, helped by @tom_mens (everything else but before) and Alix Decrop for the web.