• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

mlange-42 / arche / 12662138174

08 Jan 2025 01:09AM CUT coverage: 100.0%. Remained the same
12662138174

push

github

web-flow
Update benchmarks and README (#462)

Competition benchmarks are outdated, and benchmarks vs. AoS highly depend on the hardware (see #414). Therefore, the benchmarks are removed from the README.

Also, meanwhile Arche is not the fasted Go ECS anymore (if code generation is permitted, see #412). Therefore, the feature list is rewritten.

Closes #329
Closes #414
Closes #461

* Go version upgrade for benchmarks
* use Go 1.23 in CI
* make benchmarking table functionality public
* remove ArrayOfStructs benchmarks from README
* print CPU name in benchmark tables
* upgrade testify
* print arche version above benchmarks
* cleanup README
* remove readme ref from benchmarks
* update user guide and changelog
* remove table benchmarks for deprecated methods
* add a second field to benchmark comps, document it
* add world creation and ID access to benchmarks
* addWorld.Reset to benchmarks
* rework design section ofthe README
* remove statement on OESA models
* update user guide
* remove plotting code for competition benchmarks
* remove competition benchmarks code
* link go-ecs-benchmarks in README and user guide

6510 of 6510 relevant lines covered (100.0%)

113528.92 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

100.0
/ecs/bitset.go
1
package ecs
2

3
// Data structure for compact storage of booleans.
4
type bitSet struct {
5
        data []uint64
6
}
7

8
// Get a value.
9
func (b *bitSet) Get(bit eid) bool {
3,510,461✔
10
        chunk, bit := bit/wordSize, bit%wordSize
3,510,461✔
11
        mask := uint64(1 << bit)
3,510,461✔
12
        return b.data[chunk]&mask == mask
3,510,461✔
13
}
3,510,461✔
14

15
// Set a value.
16
func (b *bitSet) Set(bit eid, value bool) {
3,818,465✔
17
        chunk, bit := bit/wordSize, bit%wordSize
3,818,465✔
18
        if value {
3,848,966✔
19
                b.data[chunk] |= uint64(1 << bit)
30,501✔
20
        } else {
3,818,465✔
21
                b.data[chunk] &= uint64(^(1 << bit))
3,787,964✔
22
        }
3,787,964✔
23
}
24

25
// Reset all values.
26
func (b *bitSet) Reset() {
33✔
27
        for i := range b.data {
3,900✔
28
                b.data[i] = 0
3,867✔
29
        }
3,867✔
30
}
31

32
// Extend to hold at least the given bits.
33
func (b *bitSet) ExtendTo(length int) {
39,296✔
34
        chunks, bit := length/wordSize, length%wordSize
39,296✔
35
        if bit > 0 {
50,830✔
36
                chunks++
11,534✔
37
        }
11,534✔
38
        if len(b.data) >= chunks {
78,149✔
39
                return
38,853✔
40
        }
38,853✔
41

42
        old := b.data
443✔
43
        b.data = make([]uint64, chunks)
443✔
44

443✔
45
        copy(b.data, old)
443✔
46
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc