Emir Pasic
1d83d5ae39
Merge pull request #278 from xBlaz3kx/fix/typo
...
fix: comment typo(s)
2025-03-12 01:01:29 +01:00
Blaž Dular
67069ef985
Typo fix
2025-03-11 22:23:02 +01:00
Blaž Dular
08eae88bde
Typo fix
2025-03-11 22:13:56 +01:00
Emir Pasic
8323d02ee3
Update config.yml
2024-07-23 00:25:29 +02:00
Emir Pasic
7df43f80c7
Updated config.yml
2024-07-23 00:23:31 +02:00
Emir Pasic
ade7b27d1c
Updated config.yml
2024-07-23 00:20:40 +02:00
Emir Pasic
4b9c3ddfba
Update config.yml
2024-07-23 00:15:20 +02:00
Emir Pasic
a062dd859f
Delete .github/FUNDING.yml
2024-07-22 23:49:43 +02:00
Kashiwa
454720c27e
Improved ArrayList performance by removing size field. ( #255 )
...
* Improved ArrayList performance by removing `size` field.
Removed the `size` field from the `List` struct and replaced it with the built-in Go slice length implementation.
+ Achieved an average reduction of nearly 40% in execution time for `ArrayListGet`.
+ Achieved an average reduction of nearly 23% in memory usage for `ArrayListAdd`.
+ However, this change slightly increased the execution time for `ArrayListAdd` by 2.7%.
```
goos: linux
goarch: amd64
pkg: github.com/emirpasic/gods/v2/lists/arraylist
cpu: Intel(R) Core(TM) i7-4790 CPU @ 3.60GHz
│ old.txt │ new.txt │
│ sec/op │ sec/op vs base │
ArrayListGet100-8 51.20n ± 0% 32.49n ± 0% -36.53% (n=50)
ArrayListGet1000-8 447.5n ± 0% 270.3n ± 1% -39.60% (n=50)
ArrayListGet10000-8 4.418µ ± 1% 2.540µ ± 0% -42.52% (n=50)
ArrayListGet100000-8 44.06µ ± 0% 25.15µ ± 0% -42.91% (n=50)
ArrayListAdd100-8 726.5n ± 1% 760.5n ± 0% +4.69% (p=0.000 n=50)
ArrayListAdd1000-8 7.437µ ± 2% 7.389µ ± 1% ~ (p=0.746 n=50)
ArrayListAdd10000-8 70.06µ ± 1% 74.34µ ± 1% +6.11% (p=0.000 n=50)
ArrayListAdd100000-8 740.2µ ± 1% 728.9µ ± 2% ~ (p=0.147 n=50)
ArrayListRemove100-8 233.8n ± 0% 233.9n ± 0% ~ (p=0.162 n=50)
ArrayListRemove1000-8 2.275µ ± 0% 2.276µ ± 0% ~ (p=0.452 n=50)
ArrayListRemove10000-8 22.75µ ± 0% 22.75µ ± 0% ~ (p=0.956 n=50)
ArrayListRemove100000-8 1.323m ± 1% 1.331m ± 1% ~ (p=0.120 n=50)
geomean 7.218µ 6.119µ -15.22%
│ old.txt │ new.txt │
│ B/op │ B/op vs base │
ArrayListGet100-8 0.000 ± 0% 0.000 ± 0% ~ (p=1.000 n=50) ¹
ArrayListGet1000-8 0.000 ± 0% 0.000 ± 0% ~ (p=1.000 n=50) ¹
ArrayListGet10000-8 0.000 ± 0% 0.000 ± 0% ~ (p=1.000 n=50) ¹
ArrayListGet100000-8 0.000 ± 0% 0.000 ± 0% ~ (p=1.000 n=50) ¹
ArrayListAdd100-8 2.987Ki ± 0% 2.087Ki ± 1% -30.14% (n=50)
ArrayListAdd1000-8 27.50Ki ± 1% 23.31Ki ± 2% -15.24% (p=0.000 n=50)
ArrayListAdd10000-8 293.9Ki ± 1% 204.7Ki ± 1% -30.36% (n=50)
ArrayListAdd100000-8 2.667Mi ± 1% 2.244Mi ± 12% -15.86% (p=0.000 n=50)
ArrayListRemove100-8 0.000 ± 0% 0.000 ± 0% ~ (p=1.000 n=50) ¹
ArrayListRemove1000-8 0.000 ± 0% 0.000 ± 0% ~ (p=1.000 n=50) ¹
ArrayListRemove10000-8 0.000 ± 0% 0.000 ± 0% ~ (p=1.000 n=50) ¹
ArrayListRemove100000-8 453.5 ± 1% 457.5 ± 1% ~ (p=0.059 n=50)
geomean ² -8.38% ²
¹ all samples are equal
² summaries must be >0 to compute geomean
│ old.txt │ new.txt │
│ allocs/op │ allocs/op vs base │
ArrayListGet100-8 0.000 ± 0% 0.000 ± 0% ~ (p=1.000 n=50) ¹
ArrayListGet1000-8 0.000 ± 0% 0.000 ± 0% ~ (p=1.000 n=50) ¹
ArrayListGet10000-8 0.000 ± 0% 0.000 ± 0% ~ (p=1.000 n=50) ¹
ArrayListGet100000-8 0.000 ± 0% 0.000 ± 0% ~ (p=1.000 n=50) ¹
ArrayListAdd100-8 0.000 ± 0% 0.000 ± 0% ~ (p=1.000 n=50) ¹
ArrayListAdd1000-8 0.000 ± 0% 0.000 ± 0% ~ (p=1.000 n=50) ¹
ArrayListAdd10000-8 0.000 ± 0% 0.000 ± 0% ~ (p=1.000 n=50) ¹
ArrayListAdd100000-8 0.000 ± 0% 0.000 ± 0% ~ (p=1.000 n=50) ¹
ArrayListRemove100-8 0.000 ± 0% 0.000 ± 0% ~ (p=1.000 n=50) ¹
ArrayListRemove1000-8 0.000 ± 0% 0.000 ± 0% ~ (p=1.000 n=50) ¹
ArrayListRemove10000-8 0.000 ± 0% 0.000 ± 0% ~ (p=1.000 n=50) ¹
ArrayListRemove100000-8 0.000 ± 0% 0.000 ± 0% ~ (p=1.000 n=50) ¹
geomean ² +0.00% ²
¹ all samples are equal
² summaries must be >0 to compute geomean
```
* Improve ArrayList Remove() by `slices.Delete`
The performance of `slices.Delete()` is better
```
goos: linux
goarch: amd64
pkg: github.com/emirpasic/gods/v2/lists/arraylist
cpu: Intel(R) Core(TM) i7-4790 CPU @ 3.60GHz
│ old-remove.txt │ new-remove.txt │
│ sec/op │ sec/op vs base │
ArrayListRemove100-8 234.2n ± 1% 211.2n ± 2% -9.82% (p=0.000 n=10)
ArrayListRemove1000-8 2.293µ ± 1% 2.063µ ± 4% -10.05% (p=0.000 n=10)
ArrayListRemove10000-8 22.78µ ± 1% 20.53µ ± 2% -9.86% (p=0.000 n=10)
ArrayListRemove100000-8 1.318m ± 3% 1.279m ± 2% -2.96% (p=0.019 n=10)
geomean 11.27µ 10.34µ -8.22%
│ old-remove.txt │ new-remove.txt │
│ B/op │ B/op vs base │
ArrayListRemove100-8 0.000 ± 0% 0.000 ± 0% ~ (p=1.000 n=10) ¹
ArrayListRemove1000-8 0.000 ± 0% 0.000 ± 0% ~ (p=1.000 n=10) ¹
ArrayListRemove10000-8 0.000 ± 0% 0.000 ± 0% ~ (p=1.000 n=10) ¹
ArrayListRemove100000-8 452.0 ± 4% 444.5 ± 1% ~ (p=0.224 n=10)
geomean ² -0.42% ²
¹ all samples are equal
² summaries must be >0 to compute geomean
│ old-remove.txt │ new-remove.txt │
│ allocs/op │ allocs/op vs base │
ArrayListRemove100-8 0.000 ± 0% 0.000 ± 0% ~ (p=1.000 n=10) ¹
ArrayListRemove1000-8 0.000 ± 0% 0.000 ± 0% ~ (p=1.000 n=10) ¹
ArrayListRemove10000-8 0.000 ± 0% 0.000 ± 0% ~ (p=1.000 n=10) ¹
ArrayListRemove100000-8 0.000 ± 0% 0.000 ± 0% ~ (p=1.000 n=10) ¹
geomean ² +0.00% ²
¹ all samples are equal
² summaries must be >0 to compute geomean
```
* Improve ArrayList Clear() by using built-in clear() instead of creating a new one
* Refactor code by `slices` package.
* Refactor ArrayList Insert() by `slices.Insert()`
2024-07-18 09:41:44 -07:00
Paul Chesnais
14f714261f
Generics migration ( #237 )
...
* Generics migration
This attempts to migrate this library in the least invasive way by preserving as
much of the original API as possible. It does not change the tests in a
meaningful way nor does it attempt to upgrade any logic that can be simplified
or improved with generics. This is purely an API migration, and still requires a
lot of additional work to be fully ready.
* Fix a few broken tests around serialization
* Add v2 suffix
* Temporarily change mod name for testing
* Rename module to /v2
v2.0.0-alpha
2024-01-06 16:06:17 -08:00
Emir Pasic
10d6c5b4f2
Merge pull request #227 from thebenkogan/master
...
fix: doublylinkedlist insertion with last to first traversal
2023-09-04 10:48:07 +02:00
Ben Kogan
608766492e
fix: doublylinkedlist insertion with last to first traversal
2023-09-04 00:44:46 -04:00
Emir Pasic
702a6b2c26
Merge pull request #220 from ugurcsen/patch-1
...
Benchmark bug fixed(interface conversion).
2023-01-18 01:24:48 +01:00
Ugur SEN
9f3e98d84a
Benchmark bug fixed(interface conversion).
...
go test -run=NO_TEST -bench . -benchmem -benchtime 1s
This command gives an error (panic: interface conversion: interface {} is int, not priorityqueue.Element) and to fix this enqueue(n)s changed to enqueu(Element{})s.
2023-01-18 03:01:29 +03:00
Emir Pasic
5dd72bf1e0
Merge pull request #213 from rakiyoshi/fix-doc
...
Fix documentation
2022-10-17 19:08:05 +02:00
Ryoh Akiyoshi
789e39cb69
fix documentation
2022-10-15 23:59:12 +09:00
Emir Pasic
dbdbadc158
Merge pull request #205 from emirpasic/development
...
Fix in ArrayList.Contains function against nil values
v1.18.1
2022-04-18 20:15:28 +02:00
Emir Pasic
b486cc91bf
Fix in ArrayList.Contains function against nil values
2022-04-18 20:14:01 +02:00
Emir Pasic
e63524608b
Testing funding.yml
2022-04-15 02:17:46 +02:00
Emir Pasic
773505cfec
Merge pull request #203 from emirpasic/development
...
Implements PriorityQueue and CircularBuffer
v1.18.0
2022-04-15 01:08:25 +02:00
Emir Pasic
2bf1bd3aff
Implements PriorityQueue
2022-04-15 01:04:03 +02:00
Emir Pasic
8ace639fc3
Implements PriorityQueue
2022-04-15 01:01:35 +02:00
Emir Pasic
6b0ffefe7f
Fix iterator in binary heap
2022-04-15 00:07:42 +02:00
Emir Pasic
33e824351c
Fix circular buffer tests
2022-04-14 11:38:57 +02:00
Emir Pasic
60093dc4a3
circualbuffer example
2022-04-14 10:41:20 +02:00
Emir Pasic
9606c1a0e8
Implements CircularBuffer
2022-04-14 03:31:07 +02:00
Emir Pasic
da429eb24e
Merge pull request #202 from emirpasic/development
...
Implements queues, LinkedListQueue and ArrayQueue
v1.17.0
2022-04-13 23:19:50 +02:00
Emir Pasic
5b2385446e
Documentation fix
2022-04-13 23:14:04 +02:00
Emir Pasic
6bf61e32be
Implements queues, LinkedListQueue and ArrayQueue
2022-04-13 23:05:57 +02:00
Emir Pasic
6a0f91bdd5
Add String() to comments for all structures
2022-04-13 21:19:40 +02:00
Emir Pasic
77ed4cc146
Merge pull request #148 from AryanAhadinia/issue_146
...
Add Queue
2022-04-13 21:03:36 +02:00
Emir Pasic
7815e7de4e
Merge pull request #201 from emirpasic/development
...
SonarQube
2022-04-13 20:50:06 +02:00
Emir Pasic
74d62f4f1e
SonarQube
2022-04-13 20:46:44 +02:00
Emir Pasic
4665f56318
tmp
2022-04-13 20:29:10 +02:00
Emir Pasic
44253054e3
Merge pull request #200 from emirpasic/development
...
SonarQube
2022-04-13 20:22:56 +02:00
Emir Pasic
9e4f7a11c4
SonarQube
2022-04-13 20:19:17 +02:00
Emir Pasic
08cf24a0a0
SonarQube badge
2022-04-13 19:43:49 +02:00
Emir Pasic
1dd397e12c
SonarQube fixes
2022-04-13 19:40:28 +02:00
Emir Pasic
6356a9e470
Create sonarcloud.yml
2022-04-13 19:25:13 +02:00
Emir Pasic
f70d3dd117
Create codeql-analysis.yml
2022-04-13 19:04:55 +02:00
Emir Pasic
08ae186640
Create dependabot.yml
2022-04-13 18:51:34 +02:00
Emir Pasic
05959cbe35
Add release badge
2022-04-13 17:10:29 +02:00
Emir Pasic
92b8f18bff
Integrate sourcegraph badge
2022-04-13 17:06:48 +02:00
Emir Pasic
d953513772
Merge pull request #197 from emirpasic/development
...
Improve code coverage
2022-04-13 16:53:13 +02:00
Emir Pasic
41012c6c58
Improve code coverage
2022-04-13 16:52:21 +02:00
Emir Pasic
e2b92bbc7a
Interface implementation assertions moved outside the functions
2022-04-13 15:04:39 +02:00
Emir Pasic
363df0e21f
Comparator tests
2022-04-13 14:44:56 +02:00
Emir Pasic
1711af552f
Merge pull request #196 from emirpasic/development
...
Code Coverage Report with Badge
2022-04-13 13:31:00 +02:00
Emir Pasic
0d3ddc1d74
codeconv integration
2022-04-13 13:30:10 +02:00
Emir Pasic
138c2712da
codeconv integration
2022-04-13 13:24:23 +02:00