![]() ![]() ![]() Performance gains made by the reimplementationįor the performance evaluation, the team has used the dataset published with the Ghostery ad-blocker performance study that includes 242,945 requests across 500 popular websites. If a rule contains a single domain option, the entire domain is hashed as another token. ” If a rule has a specific hostname, it is tokenized too. The team further wrote, “ Even though by nature of hashing algorithms multiple different strings could hash to the same number (a hash collision), we use them to limit rule evaluation to only those that could possibly match. The tokens make matching much easier and faster when a URL is tokenized in the same way. “ To organize filters in a way that speeds up their matching, we observe that any alphanumeric (letters and numbers) substring that is part of a filter needs to be contained in any matching URL as well ,” the team explained.Īll these substrings are hashed to a single number that results in a number of tokens. What makes this new algorithm faster is that it quickly eliminates any rules that are not likely to match a request from search. The new implementation is based on uBlock Origin and Ghostery’s ad-blocking approach, which is tokenization specific to add-block rule matching against URLs and rule evaluation optimized to the different kinds of rules. It used the Bloom filter data structure that tracks fragments of requests that may match and rules out those that do not. The previous ad-blocking algorithm relied on the observation that most of the requests were passed through without blocking. How does this new ad-blocking algorithm work? This reimplemented version is available on Brave’s Dev channel and Nightly channel. ![]() It can also be packaged in a standalone Node.js module. The new ad-blocker implementation can be compiled to native code and run within the native browser core. The team chose Rust as it is a memory-safe and performant language. As a result, the ad-blocker is now 69x faster as compared to the current engine. Yesterday, its team announced that they have reimplemented its ad-blocker in Rust that was previously written in C++. Looks like Brave has also jumped on the bandwagon of writing or rewriting its components in the Rust programming language. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |