Linked lists are better than Vec

How could Rust be defeated by measly linked lists?!
Don't they know about cache locality?
Didn't they watch Stroustrup video?
How do we stop ceniles from making fun of Rust?
How do we cope?

Schizophrenic Conspiracy Theorist Shirt $21.68

Homeless People Are Sexy Shirt $21.68

Schizophrenic Conspiracy Theorist Shirt $21.68

  1. 1 month ago
    Anonymous

    Why don't you go back and stay there, homosexual?

  2. 1 month ago
    Anonymous

    burntsushi is a homosexual
    OP is a homosexual

    • 1 month ago
      Anonymous

      Saves 32 bits per link. Probably a big part of the reason it's more memory-efficient than pyahocorasick.
      Lets you reallocate the backing storage without worries. I don't think it's easy to know the exact number of nodes ahead of time. (Giving each node its own allocation is inefficient, staggering log(n) allocations is a lot of work. At first glance it looks like pyahocorasick gives each node its own allocation, ultimately going through PyMem_Malloc.)
      Easier to do in Rust.
      >O(n)
      O(1)

      riddle me this
      what possible reason would there be to purposefully - load 1 gig of data into memory, at once?

      • 1 month ago
        Anonymous

        https://en.wikipedia.org/wiki/Aho%E2%80%93Corasick_algorithm

        • 1 month ago
          Anonymous

          >https://en.wikipedia.org/wiki/Aho%E2%80%93Corasick_algorithm
          KWAB, everything wrong with modern software and the very reason why any PC with less than 16 GBs of RAM is a brick in 2024

        • 1 month ago
          Anonymous

          You have an enormous list of keywords you want to look for in a text corpus. You preprocess them into an automaton, and then you can search for all of them at once reasonably efficiently.

          [...]
          These are both intrusive.

          thanks

      • 1 month ago
        Anonymous

        You have an enormous list of keywords you want to look for in a text corpus. You preprocess them into an automaton, and then you can search for all of them at once reasonably efficiently.

        Did not read.
        Linked lists are either intrusive or a low IQ noob pessimization.
        End of story.

        These are both intrusive.

        • 1 month ago
          Anonymous

          How can you even frick up performance with intrusive linked lists?
          Nodes that point to other nodes instead of objects and waste space for a middle "current" pointer?

          • 1 month ago
            Anonymous

            He fricked up by not using a linked list. Then he changed it to a linked list and that worked better for this case.
            Linked lists can often frick up performance by spreading things out over a huge number of allocations. But in this particular case and with this particular allocation strategy it hugely reduced the number of allocations instead.

  3. 1 month ago
    Anonymous

    not reading all that, what's the tl;dr?

    • 1 month ago
      Anonymous

      Hurriedly made C implementation that used used linked list everywhere is faster than rust rewrite that they spend year optimizing.

  4. 1 month ago
    Anonymous

    >using indices instead of pointers
    >forcing yourself to go through an O(n) index every time instead of pointing straight at the object you want
    Why do this to yourself?

    • 1 month ago
      Anonymous

      Because every object must be checked for wrongthink, if any one object has a single collection of characters which offends a group of people it must be rewritten during runtime

    • 1 month ago
      Anonymous

      Saves 32 bits per link. Probably a big part of the reason it's more memory-efficient than pyahocorasick.
      Lets you reallocate the backing storage without worries. I don't think it's easy to know the exact number of nodes ahead of time. (Giving each node its own allocation is inefficient, staggering log(n) allocations is a lot of work. At first glance it looks like pyahocorasick gives each node its own allocation, ultimately going through PyMem_Malloc.)
      Easier to do in Rust.
      >O(n)
      O(1)

      • 1 month ago
        Anonymous

        >linked list index is O(1)
        Wait, what? What am I missing?

        • 1 month ago
          Anonymous

          You put all your nodes in an array, and instead of a pointer you use an index into the array. You index the array so it's still O(1). (But the 1 is slightly bigger.)

  5. 1 month ago
    Anonymous

    linked list of continuous buckets ftw
    or just straight out b-trees or similar variant with tree index over it if you also need random deletions and really O(1) lookup

  6. 1 month ago
    Anonymous

    Vec copy Vector from C++
    Vector C++ is cancer, error because add new values in loops, performance problems from resize on runtime or the OP problem vector capacity extra add up a lot memory usage.
    C Arrays are better solution, but C++ style focus on Vector and Rust borrow Vectors because limitations on Const generics for Arrays.
    >How could Rust be defeated by measly linked lists?!
    Borrow check can't do cyclical references, the most trivial case for cyclical references are linked list, Rust community just ignore the problem, the main reason GUI for Rust didn't happen is because GUI development is about cyclical references components or events.

    Rust Linked List tutorial.
    https://rust-unofficial.github.io/too-many-lists/

  7. 1 month ago
    Anonymous

    Did not read.
    Linked lists are either intrusive or a low IQ noob pessimization.
    End of story.

  8. 1 month ago
    Anonymous

    Chads keep winning.

  9. 1 month ago
    Anonymous

    >language filtered by LLs

Comments are closed.