Never reason from the results of a sampling profiler
Daniel Lemire
by Daniel Lemire
2d ago
In the quest for software optimization, a trusty companion is the sampling profiler, a tool available in most programming languages. These profilers work unobtrusively, taking snapshots of the program’s state and recording the currently executing function or instruction. While profilers sound like a silver bullet for identifying performance bottlenecks, their usefulness has limitations. They excel at highlighting bottlenecks, but often lack the nuance to pinpoint the root cause. In simpler cases, a profiler’s report might be enough, but relying solely on this data can lead one astray. Misinter ..read more
Visit website
Science and Technology links (May 25 2024)
Daniel Lemire
by Daniel Lemire
1w ago
Artificial intelligence is far more efficient at producing content than human beings, as far as carbon emissions go. Human brains got larger by over 5% between 1930 and 1970. Replacing plastics by ‘environment friendly’ alternatives typically results in greater greenhouse gas emissions. Prostate-specific antigen screening has only a small effect on men’s risk of dying in absolute terms. Local exposure to poor individuals reduces support for redistribution among the well-off. In other words, wealthy people are more likely to favor government programs helping the poor if they never see poor peo ..read more
Visit website
Learning from the object-oriented mania
Daniel Lemire
by Daniel Lemire
2w ago
Back when I started programming professionally, every expert and every software engineering professor would swear by object-oriented programming. Resistance was futile. History had spoken: the future was object-oriented. It is hard to understate how strong the mania was. In education, we started calling textbooks and videos ‘learning objects‘. Educators would soon ‘combine learning objects and reuse them‘. A competitor to a client I was working on at the time had written a server in C. They had to pay lip service to object-oriented programming, so they said that t ..read more
Visit website
Forwarding references in C++
Daniel Lemire
by Daniel Lemire
2w ago
In C++, there are different ways to pass a value to a function. Typically, at any given time, an object in C++ ‘belongs’ to a single function. The various ways to call a function differ in who owns the object, the caller or the callee (the function being called). The simplest one is that we pass by value. In such cases, a copy is typically made of the object and both the caller and the callee own a copy. void value(MyClass obj) {} We can pass by reference. You recognize a reference by the single ampersand (&). The caller owns the object, but the callee gets access to it. void reference(MyC ..read more
Visit website
Peer review is not the gold standard in science
Daniel Lemire
by Daniel Lemire
3w ago
Peer review as we know it today was introduced very late, over a century after the scientific revolution. It happened after Einstein’s time… arguably the most productive era in science. Current scientists often equate a success with the publication in a selective peer-reviewed venue. But that was never the scientific paradigm. In fact, it is pre-scientific thinking. Back in Einstein’s time, many scientists believed in the ether. It would have been difficult to dismiss the ether as a concept. The prudent approach would have been to pay lip service to the ether. Similarly, most scientists believ ..read more
Visit website
Should Node.js be built with ClangCL under Windows?
Daniel Lemire
by Daniel Lemire
1M ago
Under Windows, when using Visual Studio to build C++ code, there are two possible compiler strategies. The Visual Studio compiler (often referred to as MSVC) is the default compiler provided by Microsoft for Windows development. In Debug mode, the regular Visual Studio compiler produces faster compilation times and more performant code compared to ClangCL. ClangCL is part of the Clang/LLVM project, which is an open-source compiler toolchain. ClangCL is compatible with the Visual Studio runtime and links with the Microsoft implementation of the Standard Library. It’s available as an optional co ..read more
Visit website
Large language models (e.g., ChatGPT) as research assistants
Daniel Lemire
by Daniel Lemire
1M ago
Software can beat human beings at most games… from Chess to Go, and even poker. Large language models like GPT-4 offered through services such as ChatGPT allow us to solve a new breed of problems. GPT-4 can beat 90% of human beings at the bar exam. Artificial intelligence can match math Olympians. The primary skills of academics are language-related: synthesis, analogy, extrapolation, etc. Academics analyze the literature, identify gaps, and formulate research questions. They review and synthesize existing research. They write research papers, grant proposals, and reports. Being able to produc ..read more
Visit website
How do you recognize an expert?
Daniel Lemire
by Daniel Lemire
1M ago
Go back to the roots: experience. An expert is someone who has repeatedly solved the concrete problem you are encountering. If your toilet leaks, an experienced plumber is an expert. An expert has a track record and has had to face the consequences of their work. Failing is part of what makes an expert: any expert should have stories about how things went wrong. I associate the word expert with ‘the problem’ because we know that expertise does not transfer well: a plumber does not necessarily make a good electrician. And within plumbing, there are problems that only some plumbers should solve ..read more
Visit website
How quickly can you break a long string into lines?
Daniel Lemire
by Daniel Lemire
1M ago
Suppose that you receive a long string and you need to break it down into lines. Consider the simplified problems where you need to break the string into segments of (say) 72 characters. It is a relevant problem if your string is a base64 string or a Fortran formatted statement. The problem could be a bit complicated because you might need consider the syntax. So the speed of breaking into a new line every 72 characters irrespective of the content provides an upper bound on the performance of breaking content into lines. The most obvious algorithm could be to copy the content, line by line: v ..read more
Visit website
C++ web app with Crow: early scalability results
Daniel Lemire
by Daniel Lemire
1M ago
Last year, I looked at writing small “hello world” web applications in various programming languages (Go, JavaScript, Nim…). Go, using nothing but the standard library, did well. In these benchmarks, I am just programming an HTTP route that returns a small string (e.g., ‘hello world’). The query is from the host itself. The intent behind such a benchmark is to measure how well an web application might scale in the best of cases. I call such a benchmark ‘simplistic’ because nobody only ever returns just a short string and you do not usually query the server from the host. At the time, I had wan ..read more
Visit website

Follow Daniel Lemire on FeedSpot

Continue with Google
Continue with Apple
OR