Comments (15)
I would like to try this
from ada.
I give up on this someone else might take over
from ada.
@CarlosEduR Ok. So the first step is 'just' to add can_parse to our benchmarks:
ada/benchmarks/benchmark_template.cpp
Line 21 in ccb7a26
Basically copying this code, and replacing 'parse' by 'can_parse' ought to do.
This would be an excellent start.
from ada.
@CarlosEduR Would you issue a PR? This is fantastic!!!
Once we have good metrics, we can more easily test out ideas. It seems that there are obvious things that we can drop... e.g., sections of code that always succeed and do not impact the rest of the processing. We should be able to go step-by-step.
from ada.
@lemire @anonrig I'd like to keep the discussion
from ada.
Yes. Absolutely.
Right now I don't know the easiest way to go forward.
from ada.
@anonrig do you have anything specific in mind ? or should I just investigate and try to find something ?
from ada.
ideally, we should try to avoid any string allocations whenever we are calling can_parse
from ada.
I looked briefly and I am not sure what can be done directly in ada:can_parse
Maybe:
- removing allocations in the parse_url itself and url_aggregator?
- changing parse signature to maybe take directly some views and changing url_aggregator in the process ?
- maybe parsing base + rest together ? it should fail early anyway if base is not ok and we don't have to allocate result for base before we parse together anyway and have to allocate again into aggregator
from ada.
what do you guys use for profiling? I don't have much experience with C++, but I'd like to give a shot here
from ada.
@CarlosEduR What do you run in your computer? Windows, macOS, Linux?
from ada.
@lemire I currently have a dual-boot so I run Linux and Windows, but I usually go with Linux for coding.
from ada.
@lemire awesome, I'll do it right now.
from ada.
@lemire can_parse benchmark added:
bytes/URL: 86.859205
curl : OMITTED
input bytes: 8688092
number of URLs: 100025
performance counters: Enabled
rust version : 1.76.0
zuri : OMITTED
--------------------------------------------------------------------------------------------
Benchmark Time CPU Iterations UserCounters...
--------------------------------------------------------------------------------------------
BasicBench_AdaURL_href 30622042 ns 30620308 ns 23 GHz=4.24318 cycle/byte=14.8028 cycles/url=1.28576k instructions/byte=34.4159 instructions/cycle=2.32496 instructions/ns=9.86522 instructions/url=2.98934k ns/url=303.018 speed=283.736M/s time/byte=3.5244ns time/url=306.127ns url/s=3.26662M/s
BasicBench_AdaURL_aggregator_href 19617809 ns 19616697 ns 36 GHz=4.18634 cycle/byte=9.36962 cycles/url=813.838 instructions/byte=23.009 instructions/cycle=2.45571 instructions/ns=10.2804 instructions/url=1.99855k ns/url=194.403 speed=442.893M/s time/byte=2.25788ns time/url=196.118ns url/s=5.09897M/s
BasicBench_AdaURL_CanParse 19694538 ns 19692588 ns 36 GHz=4.27876 cycle/byte=9.55048 cycles/url=829.548 instructions/byte=23.5847 instructions/cycle=2.46948 instructions/ns=10.5663 instructions/url=2.04855k ns/url=193.876 speed=441.186M/s time/byte=2.26662ns time/url=196.877ns url/s=5.07932M/s
BasicBench_whatwg 53192626 ns 53182009 ns 13 GHz=4.24331 cycle/byte=25.8289 cycles/url=2.24348k instructions/byte=68.8033 instructions/cycle=2.66381 instructions/ns=11.3034 instructions/url=5.9762k ns/url=528.709 speed=163.365M/s time/byte=6.12125ns time/url=531.687ns url/s=1.88081M/s
BasicBench_ServoUrl 84392206 ns 84384304 ns 8 GHz=4.24188 cycle/byte=40.2331 cycles/url=3.49461k instructions/byte=108.216 instructions/cycle=2.68973 instructions/ns=11.4095 instructions/url=9.39958k ns/url=823.836 speed=102.959M/s time/byte=9.71264ns time/url=843.632ns url/s=1.18535M/s
from ada.
@lemire sure, I'll open a PR soon! And it sounds interesting, I'd love to help more on that too.
from ada.
Related Issues (20)
- Produce correct relative URLs HOT 3
- Unicode RGI Emoji ZWJ Sequences / WhatWG URL / CheckJoiners HOT 1
- Missing test coverage for encode_json for values smaller than 0x1f HOT 3
- Add ARM-based testing with sanitizers in continuous integration HOT 2
- Implement decodeURIComponent
- Build fails on Node.js HOT 1
- Questionable premature optimizations? HOT 4
- Non-special URIs with hosts HOT 5
- set_protocol("https:") does not work when constructing new url HOT 3
- Missing `percent_encode<true>` symbol (on MacOS/clang) HOT 4
- Add CXX_STANDARD CMake target property HOT 2
- Don't set `/WX` (warnings-as-errors) on Windows target public interface HOT 1
- Premature optimiztion HOT 3
- Mishandling of %7C in serialized search params
- Provide x86-64-v2 optimizations
- Benchmarks doesn't run on Windows HOT 5
- Let's consider dropping ada_url::url in next major HOT 5
- Add comparative fuzzer HOT 1
- Integrate `clang-tidy` HOT 1
- WHATWG URL Pattern: support for route matching HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ada.