Scala Programming Language
  1. Scala Programming Language
  2. SI-5513

Mutable BitSet does not provide efficient logical operations

    Details

    • Type: Improvement Improvement
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: Scala 2.9.1
    • Fix Version/s: None
    • Component/s: Collections
    • Labels:

      Description

      The mutable BitSet does not expose mutating efficient logical operations like or, and, xor, and so on taking another BitSet.

      I think those methods are an essential part of using mutable BitSets.

        Activity

        Hide
        Christopher Sahnwaldt added a comment -

        I agree. Please have a good look at java.util.BitSet and add methods like set(from: Int, to: Int) and so on, which are necessary for efficient 'batch' operations. Thanks!

        Show
        Christopher Sahnwaldt added a comment - I agree. Please have a good look at java.util.BitSet and add methods like set(from: Int, to: Int) and so on, which are necessary for efficient 'batch' operations. Thanks!
        Hide
        Adriaan Moors added a comment -

        We're happy to take pull requests for this! Unfortunately we do not have the resources to do this ourselves.

        Show
        Adriaan Moors added a comment - We're happy to take pull requests for this! Unfortunately we do not have the resources to do this ourselves.
        Hide
        Igor Petruk added a comment -

        I've looked at BitSetLike. I does copying of all bits, plus it does so two times on each operation. I can play with trying to implement it with Vector instead of Array and see what loss/win we have

        Show
        Igor Petruk added a comment - I've looked at BitSetLike. I does copying of all bits, plus it does so two times on each operation. I can play with trying to implement it with Vector instead of Array and see what loss/win we have
        Show
        James Iry added a comment - https://github.com/scala/scala/pull/2235
        Hide
        Denis Petrov added a comment - - edited

        In the current implementation mutable BitSet is required on the right hand side of those logical operations.
        In code like set1 |= set2 both sets have to be mutable, although set2 does not have to be mutable to perform the operation.

        Show
        Denis Petrov added a comment - - edited In the current implementation mutable BitSet is required on the right hand side of those logical operations. In code like set1 |= set2 both sets have to be mutable, although set2 does not have to be mutable to perform the operation.

          People

          • Assignee:
            Unassigned
            Reporter:
            ziggystar
          • Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

            Dates

            • Created:
              Updated:

              Development