M
MercyNews
Home
Back
Black-White Array: A New Data Structure with O(log N) Allocations
Technology

Black-White Array: A New Data Structure with O(log N) Allocations

The Black-White Array (BWA) is a new ordered data structure offering performance comparable to Google's BTree with significantly lower memory allocation overhead, improved cache locality, and simplified handling of duplicate keys.

Habr2d ago
5 min read
📋

Quick Summary

  • 1The Black-White Array (BWA) is a new ordered data structure offering amortized insertion, search, and deletion times comparable to Google's BTree implementation.
  • 2It achieves significantly lower memory allocation overhead during insertions, reducing pressure on garbage collectors and minimizing memory fragmentation.
  • 3BWA utilizes underlying arrays for data storage, which improves processor cache locality and speeds up data traversal and access.
  • 4The structure natively supports duplicate keys and offers low overhead for metadata, resulting in memory savings and simplified serialization.

Contents

Performance ParityMemory EfficiencyCache Locality & ArraysPractical FeaturesLooking Ahead

Quick Summary#

The Black-White Array (BWA) has emerged as a novel ordered data structure designed to optimize memory usage and processing speed. This new architecture promises performance characteristics that rival established industry standards while addressing common inefficiencies in memory management.

BWA is engineered to deliver amortized O(log N) complexity for key operations including insertion, search, and deletion. Its design focuses on minimizing the overhead typically associated with dynamic data structures, making it a compelling option for high-performance computing environments where memory allocation and cache efficiency are critical.

Performance Parity#

One of the most significant claims regarding the Black-White Array is its performance benchmarking. The structure offers amortized time complexity for insertion, deletion, and search operations that is directly comparable to the implementation of BTree from Google. This parity suggests that BWA can serve as a viable alternative in scenarios where BTree structures are currently the standard for ordered data storage.

Despite the complex nature of its internal mechanics, BWA maintains a high level of efficiency. By balancing the tree-like structure with array-based storage, it avoids the deep recursion or pointer chasing that can slow down traditional tree structures. This results in consistent performance even as the dataset grows in size.

  • Insertion operations maintain logarithmic time complexity
  • Search and deletion speeds match industry-standard BTree implementations
  • Amortized analysis ensures consistent performance over time

Memory Efficiency#

A primary advantage of the Black-White Array is its drastically reduced memory allocation requirements during insertions. Unlike many dynamic structures that require frequent reallocation and copying, BWA minimizes these operations. This reduction in allocation frequency directly translates to less pressure on garbage collectors in managed languages and significantly lower memory fragmentation over the lifecycle of the application.

The structure also boasts a low overhead for storing service information. By optimizing how metadata is tracked within the structure, BWA achieves memory savings compared to other data structures that require extensive pointers or auxiliary arrays to maintain state. This efficiency is particularly beneficial in memory-constrained environments or when handling massive datasets.

Low overhead on storage of service information - memory savings compared to other data structures.

Cache Locality & Arrays#

Under the hood, BWA relies on arrays as its fundamental storage mechanism. This design choice is critical for modern processor architecture. Because data elements are stored contiguously in memory, the structure significantly improves processor cache locality. When the CPU accesses one element, adjacent elements are likely loaded into the cache, reducing the latency associated with fetching data from main memory.

This array-based approach accelerates both the speed of data traversal and direct access to specific records. Sequential scanning of data becomes exceptionally fast, which is a common operation in database indexing and in-memory analytics. The contiguous layout eliminates the overhead of navigating disparate memory addresses, a common bottleneck in pointer-heavy structures.

  • Contiguous data storage enhances cache line utilization
  • Reduced memory latency during sequential scans
  • Optimized for modern CPU prefetching algorithms

Practical Features#

The Black-White Array introduces several practical features that simplify data management. Notably, it allows the storage of elements with identical keys without the need for external structures. This native support for duplicates eliminates the complexity of managing separate grouping mechanisms, such as auxiliary lists or maps, which are often required in standard B-Tree implementations.

Furthermore, the structure is highly optimized for batch insertions. Its design accommodates the efficient addition of multiple elements at once, reducing the overhead associated with individual insert operations. Additionally, BWA supports simple serialization and deserialization. Because the data resides in a predictable array format, converting the structure to a byte stream for storage or network transmission—and reconstructing it—is straightforward and efficient.

  • Native support for duplicate keys simplifies data modeling
  • Optimized for batch operations to improve throughput
  • Serialization is streamlined due to array-based layout

Looking Ahead#

The Black-White Array represents a significant evolution in data structure design, balancing the performance of B-Trees with the memory efficiency of arrays. By addressing key pain points such as memory fragmentation, cache inefficiency, and the handling of duplicate keys, BWA offers a robust solution for modern software engineering challenges.

As applications continue to demand higher performance and lower resource consumption, structures like BWA are poised to become essential tools in the developer's toolkit. Its combination of theoretical efficiency and practical utility suggests a promising future for this innovative approach to data organization.

Frequently Asked Questions

The Black-White Array is a new ordered data structure designed to handle insertion, search, and deletion operations with amortized O(log N) complexity. It utilizes an array-based architecture to improve memory efficiency and cache performance compared to traditional pointer-based structures.

BWA offers performance characteristics that are directly comparable to Google's BTree implementation. It achieves similar speed for key operations while providing additional benefits such as reduced memory allocation overhead and improved cache locality.

Key advantages include low memory allocation overhead, which reduces garbage collection pressure and fragmentation. It also offers excellent cache locality due to its array-based storage, native support for duplicate keys, and simple serialization for easy data persistence.

#алгоритмы#структуры данных#computer science#множество#orderedset#производительность#optimization#allocation#индексы#оптимизация

Continue scrolling for more

AI Transforms Mathematical Research and Proofs
Technology

AI Transforms Mathematical Research and Proofs

Artificial intelligence is shifting from a promise to a reality in mathematics. Machine learning models are now generating original theorems, forcing a reevaluation of research and teaching methods.

Just now
4 min
223
Read Article
A leading European AI startup says its edge over Silicon Valley isn't better tech — it's not being American
Technology

A leading European AI startup says its edge over Silicon Valley isn't better tech — it's not being American

Mistral CEO Arthur Mensch says its edge over Silicon Valley isn't smarter models, but being a European alternative built for control, sovereignty, and trust. LUDOVIC MARIN/POOL/AFP via Getty Images Arthur Mensch, CEO and cofounder of Mistral, said being non-American is a competitive edge its home market. He said European governments and regulated firms want AI that they can control without US providers. AI power will be multipolar, favoring regional players over Silicon Valley giants, he said. As the race to dominate AI accelerates, Europe's most prominent AI startup is betting that geography — not just technology — can be a competitive advantage in its home market. Arthur Mensch, the CEO and cofounder of French AI company Mistral, said the company's edge in Europe over Silicon Valley rivals like OpenAI, Google, and Anthropic isn't about having dramatically smarter models. Instead, he said that many European governments and regulated enterprises are seeking AI systems they can control, customize, and operate independently, rather than relying on a small number of external providers. "European governments are coming to us because they want to build the technology and they want to serve their citizens," Mensch said on the "Big Technology Podcast" on Wednesday. When models converge, control becomes the moat Mistral, founded in 2023 and now valued at roughly $14 billion, develops large language models that rival those of leading US systems. But Mensch said that frontier AI models are rapidly converging in performance as research spreads and training techniques become widely available. As a result, the real battleground is shifting away from raw intelligence and toward deployment, control, and trust — a shift that plays directly into Mistral's pitch in Europe. Mensch said governments, banks, and heavily regulated industries want AI systems they can customize, deploy locally, and operate independently — without fear that a single vendor could change the rules or shut off access. The approach has already paid off. France's military recently selected Mistral for an AI deal that keeps sensitive systems running on French-controlled infrastructure. AI sovereignty beats regulatory arbitrage Mensch pushed back on the idea that the company benefits merely from EU regulation or protectionism. Instead, he framed the demand as geopolitical and operational. European governments, he said, want AI that they can govern themselves and use to serve citizens without depending on foreign platforms. The same logic applies to regulated enterprises that need tighter control over data, compliance, and security. Mistral's embrace of open-source models is central to that strategy. Open source allows customers to run AI on their own infrastructure, build redundancy, and avoid vendor lock-in — a sharp contrast to the closed, centralized platforms favored by many US firms. A multi-polar AI future The appeal isn't limited to Europe. Mensch said Mistral also works with US and Asian customers who want to reduce dependence on a small group of American providers and retain more autonomy over how AI is used inside their organizations. That approach is already extending beyond the West. Mistral recently deepened a partnership with Morocco's government to co-build locally tailored AI models and launch a joint research and development lab aimed at strengthening the country's technological autonomy. Long term, Mensch said he doesn't believe AI will be dominated by a single winner or country. Instead, he expects multiple regional centers of expertise shaped by local needs, industries, and political realities. In that future, he suggested, Mistral's biggest advantage may not be the models it builds — but where, and how, it builds them. Do you work for Mistral and have a tip or story to share? Contact this reporter via email at tspirlet@businessinsider.com or Signal at thibaultspirlet.40. Use a personal email address, a nonwork WiFi network, and a nonwork device; here's our guide to sharing information securely. Read the original article on Business Insider

16m
3 min
0
Read Article
An OpenAI-backed humanoid robot startup says it's moving away from using humans to train its Optimus rival
Technology

An OpenAI-backed humanoid robot startup says it's moving away from using humans to train its Optimus rival

1X's humanoid robot, Neo, will cost $20,000 or $500 a month via subscription. Camille Cohen for The Washington Post via Getty Images Humanoid robots often require human "teleoperators" to train them by acting out mundane household tasks. The CEO of Tesla rival 1X told BI it was moving away from using human operators thanks to a new AI model. The startup's robot, Neo, is set to enter customer homes this year. AI is taking another job from humans — training robots. Tesla rival 1X launched a new AI model on Monday that the OpenAI-backed startup's CEO said would allow the company to move away from using humans to train its humanoid robot, Neo. Humanoid robot companies, including 1X, typically employ armies of human operators and data collectors to train their machines by having them perform tasks ranging from squatting to washing dishes while being recorded or wearing sensors. 1X CEO Bernt Børnich told Business Insider that his startup's new "world model" would allow Neo to learn directly from video captured by the robot itself, rather than relying on data collected by human operators. "Essentially, the world model does the same thing as the operator would do," said Børnich, adding that he expected the update to improve Neo's ability to generalize and tackle tasks it has not encountered before. "The big unlock is essentially now that intelligence scales with the number of deployed robots, instead of the number of operators you have gathering data," he said. AI training has become an increasingly popular source of work, whether it's improving robots or large language models like ChatGPT. In robot training, operators often use virtual reality headsets, motion-capture suits, and controllers to "teleoperate" the machines through simple tasks, providing data that trains the humanoid's AI model to navigate the physical world. A spokesperson for 1X said the new world model "significantly reduces" the company's reliance on teleoperation, adding that data would likely largely be collected by the robots themselves in the future. Robot operators have previously told Business Insider that the role is physically demanding and often tedious, with some working on Tesla's Optimus saying they sustained injuries as a result. Positions are often advertised on a shift basis, with pay starting at $25 an hour at both Tesla and 1X. 1X is not the only company to shift its data collection strategy away from teleoperation. 1X says Neo is designed to tackle "boring and mundane tasks around the house." 1X Business Insider's Grace Kay reported last August that Tesla had revamped its Optimus training strategy to rely on video rather than on data collected from humans wearing motion-capture suits and VR headsets. Other robotics labs are also pursuing world models, which are AI models capable of simulating realistic environments and real-world physics, as they look for more high-quality data to train their humanoids. Neo sets out on its own 1X's Neo set the internet abuzz last October with a 10-minute video demo that showed the robot vacuuming, folding laundry, and unloading a dishwasher. Neo is priced at $20,000 as a one-off payment or $500 a month subscription and is expected to ship this year — but the robotic helper comes with a catch. Early adopters can expect Neo to be piloted by a remote human operator at least some of the time, to perform housekeeping tasks that the robot can't do autonomously and collect further data to train the underlying AI models. Børnich said it would be very clear when the Neo is being teleoperated and that 1X was taking all the necessary steps to protect user privacy. He compared Neo in teleoperated mode to inviting a human inside your home to help out. 1X, which raised $100 million in 2024 and has been backed by OpenAI and Samsung, intends to move away from teleoperation in customer environments, too. Børnich said that the company's advances in its world model meant he expected Neo to be able to perform most tasks autonomously by the end of this year. "I think sometime in 2026, we will be able to ship you something that is fully autonomous out of the box and does not actually require any human intervention except for yourself," Børnich said. The Norwegian executive added that 1X expected to produce over 10,000 robots this year and that the company "sold out in the first few days" following the viral demo. A 1X spokesperson said customers previously had a narrow set of "hero" tasks that Neo could tackle autonomously, but that has now changed so that the robot will attempt all tasks without human support. "Task execution may not always be perfect, and it may struggle at hard tasks, but it will learn over time," they said. Do you work in the robotics industry or have a tip? Contact this reporter via email at tcarter@businessinsider.com or Signal at tcarter.41. Use a personal email address, a nonwork WiFi network, and a nonwork device; here's our guide to sharing information securely. Read the original article on Business Insider

27m
3 min
0
Read Article
Google Tightens Crypto Rules in South Korea
Cryptocurrency

Google Tightens Crypto Rules in South Korea

Google's updated policy requires proof of FIU registration for crypto apps, raising significant compliance hurdles for offshore exchanges targeting South Korean users.

32m
5 min
6
Read Article
AI Cybersecurity Divide: CEOs Split on Risks
Technology

AI Cybersecurity Divide: CEOs Split on Risks

A new survey reveals a growing divide among C-suite executives on the cybersecurity risks and rewards of artificial intelligence, highlighting divergent perspectives at the highest levels of corporate leadership.

41m
5 min
6
Read Article
Reid Hoffman's AI Christmas Gift: Music Album
Technology

Reid Hoffman's AI Christmas Gift: Music Album

The billionaire LinkedIn cofounder generated silly Christmas songs using AI and pressed them onto records as unique presents for his loved ones.

45m
5 min
6
Read Article
Rails Creator: AI Still Can't Beat Junior Programmers
Technology

Rails Creator: AI Still Can't Beat Junior Programmers

Ruby on Rails creator David Heinemeier Hansson remains skeptical of AI's current coding capabilities, comparing it to a flickering light bulb while marveling at the US economy's massive bets on the technology.

48m
5 min
5
Read Article
NASA Prepares First Crewed Moon Mission in 50 Years
Science

NASA Prepares First Crewed Moon Mission in 50 Years

NASA is preparing to launch its first crewed moon mission in more than 50 years, with a historic flyaround planned for early February from Florida's Kennedy Space Center.

1h
5 min
12
Read Article
Semafor's Washington Strategy: Building a Profitable Media Empire
Politics

Semafor's Washington Strategy: Building a Profitable Media Empire

The news startup founded by Ben Smith and Justin Smith has achieved profitability in just three years by focusing on Washington's unique intersection of business and politics.

1h
7 min
12
Read Article
AI Won't Kill Jobs, Says Nvidia CEO
Technology

AI Won't Kill Jobs, Says Nvidia CEO

Nvidia CEO Jensen Huang explains why AI won't destroy jobs, highlighting how automating tasks can actually increase demand for human expertise in fields like radiology, law, and software engineering.

1h
7 min
6
Read Article
🎉

You're all caught up!

Check back later for more stories

Back to Home