Now Reading
a URL parsing benchmark – Daniel Lemire’s weblog

a URL parsing benchmark – Daniel Lemire’s weblog

2023-05-03 14:31:47

Everytime you enter a URL right into a system, it have to be parsed and validated. It’s a surprisingly difficult job: it could require lots of of nanoseconds and probably over a thousand cycles to parse a typical URL.

We are able to use URL parsing as an inexpensive benchmark of a system efficiency. In fact, no single measure is enough… however URL parsing is fascinating as a result of it’s a pretty generic job involving strings, and substrings, and characters searches and so forth.

I’m going to check the next ARM-based methods:

  • c7g.giant: Amazon Graviton 3 operating Ubuntu 22.04 (GCC 11)
  • macBook Air 2022: Apple M2 LLVM 14
  • Home windows Dev Equipment 2023: Qualcomm 8cx third gen operating Ubuntu 22.04 (GCC 11) inside WSL (Home windows 11)

The Windows Dev Kit is a little plastic box designed to permit Home windows builders to get their functions prepared for Home windows for 64-bit ARM. It’s a tiny low-power system that I go away on my desk. The Amazon Graviton 3 nodes from Amazon are their greatest ARM-based servers. The macBook Air incorporates probably the greatest laptop computer processors in the marketplace.

The benchmark we run masses 100,000 URLs discovered on the highest 100 most visited websites. It’s single-threaded and requires no disk or community entry: it’s a pure CPU check.

I run the next routine:

  • git clone https://github.com/ada-url/ada
  • cd ada
  • cmake -B construct -D ADA_BENCHMARKS=ON
  • cmake --build construct --target benchdata
  • ./construct/benchmarks/benchdata --benchmark_filter=BasicBench_AdaURL_aggregator_href
Graviton 3 285 ns/url
Apple M2 190 ns/url
Qualcomm 8cx third gen 245 ns/url

We are able to additionally plot these common timings.

On this explicit benchmark, the Qualcomm processor is 30% slower than the Apple M2 processor. That’s to be anticipated: Apple Silicon is mostly superior.

Nonetheless, on this explicit check, the Qualcomm system beats the Graviton 3 node from Amazon. On a associated benchmark, I showed that the Graviton 3 had competitive performance and could beat state-of-the-art Intel Ice Lake nodes. Amazon themselves claim that Graviton 3 instances might be superior for machine learning tasks.

We are able to attempt to right for frequency variations. The Graviton runs at 2.6 GHz, the Apple M2 runs at 3.5 GHz and the Qualcomm processor at 3.0 GHz. Allow us to right the numbers:

Graviton 3 (mannequin) 245 ns/url (corrected for 3 GHz)
Apple M2 (mannequin) 220 ns/url (corrected for 3 GHz)
Qualcomm 8cx third gen 245 ns/url

Be aware that you just can’t blindly right for frequency on this method as a result of it’s not bodily doable to simply change the frequency as I did: it’s a mannequin to assist us suppose.

General, these numbers recommend that the Qualcomm processor is aggressive. It’s not prone to set up velocity information, however I’d not shrink back from a Qualcomm-based system whether it is meant for low energy utilization.

See Also

How doubtless is it that my outcomes are deceptive? They appear to match roughly the outcomes that Alex Ellis received operating a extra full benchmark:

So I imagine that my result’s roughly right: Qualcomm is inferior to Apple Silicon, however not by a really extensive margin.

A separate situation is the Home windows efficiency itself. A lot of Home windows continues to be x86 particular and although Home windows can run x86 functions in emulation underneath 64-bit ARM, there’s a penalty which might be substantial. However, my very own expertise has been fairly good. In fact, I don’t play video games on these machines nor do I do video enhancing. Your mileage will fluctuate.

Additional studying: Linux on Microsoft Dev Kit 2023



Source Link

What's Your Reaction?
Excited
0
Happy
0
In Love
0
Not Sure
0
Silly
0
View Comments (0)

Leave a Reply

Your email address will not be published.

2022 Blinking Robots.
WordPress by Doejo

Scroll To Top