· AI dev tools

Marginalia Search, Money, C++, Rust, AI, Stuff update mentions Java to C++ index migration experiments

The current state of the search engine shows that most of its major components are already established, meaning that substantial new features are unlikely to appear in the immediate future, which is…


The current state of the search engine shows that most of its major components are already established, meaning that substantial new features are unlikely to appear in the immediate future, which is a predictable pattern akin to binary searches where finer adjustments become necessary as a target nears.

This brief update serves as a pro forma project status report, and it is worth noting that the recent months have primarily involved cleaning up technical debt and addressing bugs rather than unveiling new functionality. While the search engine is performing quite well and appears to be moving in a positive direction—perhaps bolstered by the bug fixes and ongoing optimization efforts—it is not yet entirely self-sufficient financially.

SerpApi provided the project with a $10k sponsorship some time ago, and since the summer, the volume of donations and API-key sales has shown consistent month-over-month increases. Furthermore, the project has garnered unexpected attention, as I frequently observe it appearing in YouTube videos and articles authored by Claude in lists of search engines. I lack analytics, so I have no concrete data regarding user numbers or their usage patterns, but the increasing interest is certainly noticeable.

Regarding the process of distributing free API keys, I have been deliberately slow, sometimes requiring a wait of a week or two. This delay is not a calculated move to push users toward paid keys; rather, I receive over a dozen emails daily requesting keys, which sometimes accumulate into large piles. The manual process of handling these requests—transferring information from email to a form, and then back from the form to email—is incredibly tedious, ironically mirroring the exact kind of repetitive workflow I have spent my career helping others automate and streamline.

Beyond fixing minor issues and implementing small enhancements, a significant area of experimentation involves transitioning the index code from Java to C++. I have not finalized this strategic decision, as large-scale rewrites, particularly across different languages, generally conflict with my professional judgment. However, because the system is currently CPU-bound, there is potential to gain efficiency by bypassing the overhead associated with the JVM, and Java simply doesn't suit this specific use case well.

While the newer Java FFM API represents a substantial improvement over previous methods, managing off-heap memory remains cumbersome, leading to redundant implementations of algorithms like searching and sorting that already exist for on-heap structures but not for off-heap ones. Moreover, the constant switching between native code and Java makes the logical flow difficult to trace, creating a persistent sense of friction.

The pursuit of optimizations within the index is fundamentally tied to the core requirement of any internet search engine: performance equates to recall. The system’s effectiveness is ultimately limited by the quantity of results it can rank within the allotted execution time for a query. Candidly, I am not entirely certain that we will observe a massive performance uplift, especially since the Java implementation is already highly optimized, and the bottlenecks are not in areas where language differences typically yield dramatic gains.

To date, the buffer pool and a segment of the primary inverse index structure have been translated. These represent some of the most delicate parts of the index, making them a reasonable indicator of feasibility. Based on my progress, the superior expressiveness C++ offers for this type of work is encouraging. The significant improvement in ergonomics alone might motivate me to continue this effort, even if the anticipated performance gains do not fully materialize. I am proceeding cautiously, tackling one component at a time, adhering to a philosophy of measuring meticulously before acting, and seeking out abstractions that leverage C++’s inherent strengths instead of merely translating code line-for-line.

This work is intensely technical and fiddly, and since there is no pressing deadline, I believe that if significant performance gains are attainable, they will likely emerge from prolonged contemplation of the problem, leading to superior alternative approaches. For example, I have managed to incorporate more lock-free algorithms within the buffer pool. Given the current pace, completing the translation this year seems unlikely.

Several elements remain undetermined, including where the interface boundary should be drawn, and I have yet to establish a public Git repository for the project; it is still possible I might abandon the entire endeavor as a fanciful diversion. We will simply have to observe how things unfold.

Should this rambling update ever appear on a link aggregator, I anticipate two distinct types of readers will engage, and I wish to preemptively address their anticipated concerns. I must respond to the assertion, "Why not Rust/Zig/Odin/${MY_HOBBY_HORSE_LANGUAGE}? C++ is not memory safe! Haven't you heard that C++ is bad? Look at this diseased rat comic I found on /r/programming!" My response is that I utilize C++ due to my prior experience building substantial projects with it, and I am familiar with its tooling, which I also find enjoyable. It cannot be overstated how highly technical this code is; it is sufficiently difficult in a language I know well, let alone one I would need to learn concurrently. I do not require an extreme scenario, such as blindfolded navigation through a barrel descending Niagara Falls, for the task to be challenging.

To the query, "${FRONTIER_MODEL} could one-shot this in less than ${TIME}!" This might indeed be true, given that the source material is quite thoroughly tested and includes a reference implementation, suggesting favorable conditions for a proficient coding model. Nevertheless, even setting aside broad considerations like "externalities of the datacenter buildout," "externalities of AI training," and "legal ownership status of AI-generated code," I doubt such arguments would sway anyone who is not already convinced. If an AI were to perform the translation, I certainly would not be capable of maintaining that code. Even in the most optimistic scenario, I am operating at the very limits of my programming capabilities. Low-level, performance-critical programming is inherently difficult even for the designer; it becomes exponentially harder if the code is generated via some form of "vibe coding." I would then be dependent on an AI subscription, constantly hoping token prices do not escalate. This scenario is untenable for the same reasons the search engine runs on dedicated hardware rather than in a cloud environment; true independence is impossible when subject to a landlord's whims.

From a project management viewpoint, I am deliberately not rushing anything toward a market release; the project still possesses years of runway. I am not obligated to investors to generate profits, and even if I wished to, I have no personnel to replace except myself. What I value most is the deep immersion in the problem domain that has allowed me to reach this point. My expectation from this work is an enhancement in developer ergonomics, perhaps coupled with some performance gains if this immersion proves fruitful. This is not a venture designed to generate income, which is possible because the project is in a relatively stable and mature phase. Therefore, irrespective of future developments in AI, there is no apparent opportunity cost to maintaining the current pace. Considering popular future predictions about AI, where does this leave me? Lesser thinkers might interpret models producing unmaintainable code as evidence of AI's superiority; for that specific viewpoint, I direct you to the most controversial prophet, Terry Davis. I used an em-dash in that preceding paragraph. I invite discussion on whether Mr. Robot authored this piece.

Why it matters

For developers interested in high-performance tooling, this signals ongoing architectural decisions regarding language choices for critical search engine components. The shift from Java to C++ highlights the trade-offs between performance gains and development ergonomics in complex systems.

Related coverage

Also worth reading

  1. UK ministers blame AI-assisted hackers for DWP benefits system meltdown
  2. Open Source sustainability challenged by AI's flood of work, developer burnout
  3. Node 26.14.0 released, adding child_process.timedOut, fs.mkstemp, and http batch body spans
  4. next.js 16.5.0-rc.1 released, fixing image cache ages and keeping immutable assets
  5. Angular 22.3.1 released with fixes to animations, compiler, and core functionality