6 ms·
Parsing millions of URLs per Second (2023)
- notamy 2y agoThe title seems to have a few words missing. Original title: > Parsing millions of URLs per second
- HL33tibCe7 2y agoHN’s stupid/arrogant automatic title rewriter strikes again
- PaulHoule 2y agoFixed
- ignoramous 2y agoSo, suprassing 80k karma, one gets title edit rights?
- PaulHoule 2y agoI think anybody can edit a title within a short time of posting something. Or if there is a karma threshold it is way less than 80k. I caught that one manually but YOShInOn's tail end needs some love and could be updated so it that it fixes up titles that get mashed automatically or adds a comment sometimes to editorialize or provide an archive link.
- kristianp 2y agoI've never noticed a title being rewritten automatically when posting an article. Are you sure that's really a thing?
- pests 2y agoThere are some auto rewrite rules. Off the top of my head: numbers in the beginning are stripped, [pdf] or [video] can be added to the end, and one more I can't remember that gets stripped off beginning and can cause confusion. A pdf link to "5 Reasons To Do Things" will be "Reasons To Do Things [pdf]" for example.
- deleted 2y ago[deleted]
- Tomte 2y ago„How“ at the beginning is stripped, leading to all these strange sounding „I <verb>“ submissions.
- TRiG_Ireland 2y agoThere was also an interesting article on assistive technology called "How Disabled People Use the Web", or something similar, which looked very silly with the "How" stripped.
- Tomte 2y agoYes. And the algorithm is really incredibly stupid, but dang is opposed to even small improvements (like showing the changed title on submission beforehand, like the „x characters to long“ message).
- Cicero22 2y agoThis sort of work is something I wouldn't be able to do, but I can't help but point out at least one potential issue with the paper. It's a lot easier to find problems than solutions I guess. Are the benchmarks comparing node versions valid to conclude a real world performance increase? one possible confounder is the version of V8. https://github.com/nodejs/node/blob/v18.x/deps/v8/include/v8-version.h https://github.com/nodejs/node/blob/v18.x/deps/v8/include/v8... https://github.com/nodejs/node/blob/v20.x/deps/v8/include/v8-version.h https://github.com/nodejs/node/blob/v20.x/deps/v8/include/v8... ideally, they would've patched Node 18.15 with their changes directly and test their patch against 18.15.
- TZubiri 2y ago[flagged]
- fabrice_d 2y agoThe article explains optimizations to spend less cycles parsing URLs than other libraries. Very interesting work, there's no reason not to do things efficiently when it's possible. Also, good luck using regex to write a RFC or WHATWG conformant URL parser.
- TZubiri 2y ago2 minutes reading an rfc about uris and I find a regex literally used in the specs: https://www.rfc-editor.org/rfc/rfc3986#page-7 https://www.rfc-editor.org/rfc/rfc3986#page-7 >> The following line is the regular expression for breaking-down a well-formed URI reference into its components. >> ^(([^:/?#]+):)?(//([^/?#]))?([^?#])(\?([^#]))?(#(.))? Did Chomsky die for nothing? I guess there are reasons to do things efficiently when possible, but a million URLs is not it, the adage about the root of all evil comes to mind. A billion URLs per second and it's almost interesting, but not really.
- FroshKiller 2y agoThe spec provides an expression for "well-formed" URIs. Good luck with real-world input.
- switchbak 2y agoLast I heard Noam Chomsky was still alive, and a quick Google doesn’t contradict that. Or is this some kind of high brow joke that went over my head?
- throw16180339 2y agoI think they're joking about Chomsky's work with formal languages (https://en.wikipedia.org/wiki/Chomsky_hierarchy https://en.wikipedia.org/wiki/Chomsky_hierarchy).
- beached_whale 2y agoFound the easier to read/download from Arxiv link https://arxiv.org/abs/2311.10533 https://arxiv.org/abs/2311.10533
- deleted 2y ago[deleted]
- maartenscholl 2y agoI had a lot of fun writing low latency parsers for various message standards C++. There are a lot of fun things you can do when you can take ownership of the read buffer and you can figure out how to parse in-situ (modifying the data in place as you move along)
- deleted 2y ago[deleted]
- Thorrez 2y ago> For example, the input string http://你好你好.在线/./a/../b/./c http://xn--6qqa088eba.xn--3ds443g/./a/../b/./c should be normalized to the string https://xn–6qqa088eba.xn–3ds/b/c https://xn--xn6qqa088eba-l19f.xn--xn3ds-zu3b/b/c Why would normalization change http:// http:// to https:// https:// ?
- ramon156 2y agoBecause its 2024
- marginalia_nu 2y agohttp:// http:// is not a typo for https:// https://. There's still a fairly large amount of web servers that do not talk https, and you simply cannot assume that they do. That will leave you with a lot of dead links. Besides, most that accept both will auto-renegotiate to https.
- TacticalCoder 2y ago> There's still a fairly large amount of web servers that do not talk https, and you simply cannot assume that they do. OTOH I'm browsing since years forcing HTTPS only and life goes on fine. If the absolute worse comes to worse, I can use archive.is or archive.org but it's very rare that I need that. Basically: if a link is HTTP to me it's not worth opening. The one exception would be Debian packages URLs: but these are signed and the signatures are verified. User _apt is the only one allowed to emit HTTP traffic. This prevents my ISP or anyone else injecting nasty stuff.
- forgotmypw17 2y agoJust because it is accessible to you does not mean it is accessible to everyone else. HTTPS has many failure modes which make it unreliable for essential access, such as time mismatches, certificate expirations, ssl version mismatches, etc. Security and privacy are important, and they are also not absolute. Sometimes the risk is outweighed by the importance of being able to access essential resources and reading material.
- youngtaff 2y agoLemire’s blog is well worth a read if you’re interested in this sort of thing https://lemire.me/blog/ https://lemire.me/blog/
- grayhatter 2y agoI wonder how much time was spent promoting this parser, vs time spent on writing it? I've seen a lot of spam for this one, and I'm not the only one. https://daniel.haxx.se/blog/2023/11/21/url-parser-performance/ https://daniel.haxx.se/blog/2023/11/21/url-parser-performanc...
- yagiznizipli 2y agoAlmost a year of development, 3 months of writing paper. All of the benchmarks are public. Run it before sharing someone else’s blog post.
- trung123f 2y agou has similar repo? tks