BLU Discuss list archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Discuss] Port Scanning
- Subject: [Discuss] Port Scanning
- From: markw at mohawksoft.com (markw at mohawksoft.com)
- Date: Wed, 7 Aug 2024 15:09:03 -0400
- In-reply-to: <28fb6173-d7ed-4363-ad84-4b47981ba157@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> <28fb6173-d7ed-4363-ad84-4b47981ba157@borg.org>
> On 8/7/24 09:41, Kent Borg wrote: > > -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*. I know you are saying this with some humor, however, it is circumstantial. What happens when you have billions of entries? 10 billion? Have you ever looked at merkle tree? AVL trees are interesting in that you can have a single "node" structure that can be unrolled into a doubly linked list and rolled back into a tree. A classic binary tree where all the values are in the leafs and the internal of the tree just leads you down the tree to the data may use more memory and managing the leaf nodes may take more CPU. Having a generic binary tree is good and all, but if your "secret sauce" is the rapid retrieval of data the generics don't work well enough. If your generic binary tree can't efficiently manage your data within the constraints of memory and CPU, then, you need to use something else. Additionally, you can structure things interestingly. If you memmap a slab of memory into your process and sub-allocate out of that, you can keep memory closer than just using malloc. A binary tree is generally represented as O(log n) but can degrade as bad as O(n) if you don't balance. You have to factor in the balancing process on insertion. You can use a hash table instead of a tree, and that can evolve into a merkle tree, if you don't expect too many collisions you implement a cuckoo hash. > > * 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.) Like I've said, I don't tend to use the generic implementations in C/C++. There are too many short comings.
- 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
- From: kentborg at borg.org (Kent Borg)
- [Discuss] Port Scanning
- Prev by Date: [Discuss] Rust vs. C (was Re: Port Scanning)
- Next by Date: [Discuss] Rust vs. C (was Re: Port Scanning)
- Previous by thread: [Discuss] Rust vs. C (was Re: Port Scanning)
- Next by thread: [Discuss] Port Scanning
- Index(es):