Skip to content

Commit 2f237c7

Browse files
author
George B
authored
decent first readme
1 parent 446a37a commit 2f237c7

File tree

1 file changed

+26
-16
lines changed

1 file changed

+26
-16
lines changed

README.md

Lines changed: 26 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,46 @@
11
# Java BitArray
22

3-
[![Open Issues][open-issues-shield]][open-issues-url]
3+
[![Latest release][latest-release-shield]][latest-release-url]  
4+
[![Open Issues][open-issues-shield]][open-issues-url]  
45
[![Contributors][contributors-shield]][contributors-url]
56

7+
### Motivation
8+
This class is a replacement for the `ArrayList<Boolean>` type when working with its `List` interface. It boasts higher performance in add, remove and set operations and requires less memory for storing the same elements.
69

10+
The BitArray is by all means an array; it is random access and all elements have contiguous indices at all times. Its behaviour is meant to be indistinguishable from ArrayList in order for programmers to be able to substitute it for the latter and benefit from its performance advantage.
711

12+
### Few details
13+
Internally the array stores the boolean elements in an array of long primitives. These long primitives essentially form a sequence of bits; their chained bit representation in 2's complement. Boolean elements are converted to and from their bit equivalent to perform insertions, deletions etc. With the appropriate bitwise operations new elements can be added at a specific index and elements already in the array can be shifted to preserve the previous order. Thanks to that hack, element shifting and array resizing is much cheaper, all while the elements themselves occupy less space in memory.
814

15+
### Performance
16+
With regard to the difference in performance, I have a [temporary benchmark](https://github.com/Abductcows/java-bit-array/blob/dev/src/test/java/gr/geompokon/bitarray/BitArrayVsArrayListBenchmarkTest.java) file for you to test. I am looking into creating a more trustworthy benchmark using a benchmark framework like [JMH](https://github.com/openjdk/jmh) in order to be able to publish some results with confidence. If you have experience doing that and want to contribute, feel free to start an [issue](https://github.com/Abductcows/java-bit-array/issues).
917

18+
### Disclaimer
19+
As you can tell from the project version and creation date this class is very new and not battle-tested. As such I would discourage you from using it in a serious application just yet.
1020

21+
# Getting Started
22+
You will need the class and source files. You can grab the [latest release](https://github.com/Abductcows/java-bit-array/releases/latest) (built for jdk-11) or download the project and run `mvn package/install` yourself. Releases contain a zip file with separate jars for classes, sources and javadoc. Include at least the class jar in your project and you will be able to use the BitArray. Looks like you are good to go.
1123

24+
### Versioning
25+
The project uses [SemVer](https://semver.org/) for versioning.
1226

27+
### Contributions and future of this project
28+
I would like to work on this project with anyone willing to contribute. My estimation of the rough priority of actions needed is:
1329

30+
- Testing/debugging: Write better and well documented tests to enhance confidence
31+
- Benchmarking: Give ArrayList a run for their money
32+
- Optimizing: 'cause why not. Maybe override a few of the AbstractList's default implementations
33+
- New features: Not sure what to add, suggestions very welcome
1434

35+
If you want to contribute, check out [CONTRIBUTING.md](https://github.com/Abductcows/java-bit-array/blob/master/CONTRIBUTING.md) for more info.
1536

16-
17-
18-
19-
20-
21-
22-
23-
24-
25-
26-
27-
28-
29-
30-
37+
### Authors
38+
- *George Bouroutzoglou* (geompokon@csd.auth.gr)
3139

3240

3341
[open-issues-url]: https://github.com/Abductcows/java-bit-array/issues
3442
[open-issues-shield]: https://img.shields.io/github/issues/abductcows/java-bit-array
3543
[contributors-url]: https://github.com/Abductcows/java-bit-array/graphs/contributors
3644
[contributors-shield]: https://img.shields.io/github/contributors/abductcows/java-bit-array
45+
[latest-release-shield]: https://img.shields.io/github/v/release/abductcows/java-bit-array?sort=semver
46+
[latest-release-url]: https://github.com/Abductcows/java-bit-array/releases/latest

0 commit comments

Comments
 (0)