BLU Discuss list archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Discuss] Port Scanning
- Subject: [Discuss] Port Scanning
- From: kentborg at borg.org (Kent Borg)
- Date: Wed, 7 Aug 2024 11:04:03 -0700
- In-reply-to: <3f557711-1713-4a88-b0bd-e843d0670ee8@borg.org>
- References: <5c43eee0-caaf-45d6-8fdb-273cb3d8ea6d@borg.org> <20240801172933.yqcdeki3ntkrrl2t@randomstring.org> <51804f85-9275-4d89-9dc2-86234cdb299b@borg.org> <20240801210627.bzw47tfmyxofcep3@randomstring.org> <82b0d41d-075d-496e-9e1f-ef1529623c38@borg.org> <20240801182824.4bf21319.Richard.Pieri@gmail.com> <f6d905fd-7886-4cf2-9b02-f6d89f60adf0@borg.org> <20240801214606.5bebc46a.Richard.Pieri@gmail.com> <20c3240d-184f-4c84-b4ed-7680ac5301bd@borg.org> <CAJFsZ=o7btMacs-OqTB0908ehYkZCFGtupLkNi59C9K8XV6zKQ@mail.gmail.com> <20240804112131.195b6e56.Richard.Pieri@gmail.com> <CAJFsZ=roiGszBrbv6CzFY57V=fBe9CnZKqBi-eSUQ8eTHPr8_A@mail.gmail.com> <20240806075246.1247c265.Richard.Pieri@gmail.com> <30f00649fdfd89126d760f2d9f105c96.squirrel@mail.mohawksoft.com> <e1589141-299b-423e-8aaa-cf2a0a9a66b4@borg.org> <20240806213934.2f8bbc9d.Richard.Pieri@gmail.com> <3f557711-1713-4a88-b0bd-e843d0670ee8@borg.org>
On 8/7/24 09:41, Kent Borg wrote: > Again, the posting says this requires further investigation with the > early guess that Rust is being nicer to the cache. Turns out there was a followup post. https://bcantrill.dtrace.org/2018/09/28/the-relative-performance-of-c-and-rust/ I think it is fair to summarize the performance difference thus: > For the C version, this is a binary search tree (an AVL tree), but > Rust (interestingly) doesn?t offer a binary search tree ? and it is > instead implemented with a BTreeSet > <https://doc.rust-lang.org/std/collections/struct.BTreeSet.html>, > which implements a B-tree <https://en.wikipedia.org/wiki/B-tree>. And...that was nicer to the cache, to the tune of being ~32% faster. A day earlier, on 8/6/24 16:31, Kent Borg wrote: > In digging a little these all seem to be due to Rust "std" library > having some very well written data structures Almost as if I knew what I was talking about. And that the people building Rust do very good work. I have to mention another followup post, from two-years later. Read "Rust after the honeymoon", for the *real* dirt. https://bcantrill.dtrace.org/2020/10/11/rust-after-the-honeymoon/ (Spoiler: No regrets.) -kb, the Kent who is lazy and likes having fast data structures for free, even though he is sure Mark could implement a faster B-tree in C*. * The BTreeSet had some funny bumps in its performance curve, where it turns out it is allocating memory. If I understand correctly these could be avoided by initializing the data structure upfront to needed size, instead of being dynamic. The catch in their case is they don't know in advance how big the data will be. The AVL tree didn't have these bumps. I don't know whether the B-tree could be implemented to avoid them, while still being as fast. I'll leave that to others. (Maybe C's tree could /add/ some bumps to get faster.)
- Follow-Ups:
- [Discuss] Port Scanning
- From: markw at mohawksoft.com (markw at mohawksoft.com)
- [Discuss] Rust vs. C (was Re: Port Scanning)
- From: richard.pieri at gmail.com (Rich Pieri)
- [Discuss] Port Scanning
- References:
- [Discuss] Port Scanning
- From: kentborg at borg.org (Kent Borg)
- [Discuss] Port Scanning
- From: dsr at randomstring.org (Dan Ritter)
- [Discuss] Port Scanning
- From: kentborg at borg.org (Kent Borg)
- [Discuss] Port Scanning
- From: dsr at randomstring.org (Dan Ritter)
- [Discuss] Port Scanning
- From: kentborg at borg.org (Kent Borg)
- [Discuss] Port Scanning
- From: richard.pieri at gmail.com (Rich Pieri)
- [Discuss] Port Scanning
- From: kentborg at borg.org (Kent Borg)
- [Discuss] Port Scanning
- From: richard.pieri at gmail.com (Rich Pieri)
- [Discuss] Port Scanning
- From: kentborg at borg.org (Kent Borg)
- [Discuss] Port Scanning
- From: bogstad at pobox.com (Bill Bogstad)
- [Discuss] Port Scanning
- From: richard.pieri at gmail.com (Rich Pieri)
- [Discuss] Port Scanning
- From: bogstad at pobox.com (Bill Bogstad)
- [Discuss] Port Scanning
- From: richard.pieri at gmail.com (Rich Pieri)
- [Discuss] Port Scanning
- From: markw at mohawksoft.com (markw at mohawksoft.com)
- [Discuss] Port Scanning
- From: kentborg at borg.org (Kent Borg)
- [Discuss] Port Scanning
- From: richard.pieri at gmail.com (Rich Pieri)
- [Discuss] Port Scanning
- From: kentborg at borg.org (Kent Borg)
- [Discuss] Port Scanning
- Prev by Date: [Discuss] Port Scanning
- Next by Date: [Discuss] Rust vs. C (was Re: Port Scanning)
- Previous by thread: [Discuss] Port Scanning
- Next by thread: [Discuss] Rust vs. C (was Re: Port Scanning)
- Index(es):