Commit Graph

825 Commits

Author SHA1 Message Date
Samuel Berthe 6f42e74a11 doc: improve examples 2026-03-02 16:06:51 +01:00
Samuel Berthe ff0e293ce3 feat: adding FilterErr helpers 2026-03-02 16:06:51 +01:00
Samuel Berthe 4bb58fd2c6 feat: adding RepeatByErr helpers 2026-03-02 16:06:51 +01:00
Samuel Berthe 72a33aa397 feat: adding FilterKeysErr + FilterValuesErr helpers 2026-03-02 16:06:51 +01:00
Samuel Berthe dd1d58e324 feat: adding FindDuplicatesByErr helper 2026-03-02 16:06:51 +01:00
Samuel Berthe 693e1ce3a8 feat: adding FilterMapToSliceErr helper 2026-03-02 16:06:51 +01:00
Samuel Berthe 7c55e5b6e3 feat: adding CrossJoinByErrX helpers 2026-03-02 16:06:51 +01:00
Samuel Berthe 8295993219 feat: adding FindErr helper 2026-03-02 16:06:51 +01:00
Samuel Berthe e94aa8d408 feat: adding ZipByErrX helpers 2026-03-02 16:06:51 +01:00
Samuel Berthe 64b0378b52 fix: fix inconsistent behavior on early return (return zero value instead of partial result) 2026-03-02 16:06:51 +01:00
Samuel Berthe fcc4f11fb5 💄 2026-03-02 16:06:51 +01:00
Samuel Berthe 5163ac211e fix: fix flaky test 2026-03-02 16:06:51 +01:00
Samuel Berthe cd78292882 💄 2026-03-02 16:06:51 +01:00
Samuel Berthe f0d6424eb0 feat: adding lots of examples of the new helpers 2026-03-02 16:06:51 +01:00
Samuel Berthe 18d953abf2 feat: adding lots of examples of the new helpers 2026-03-02 16:06:51 +01:00
Samuel Berthe 4584a0b848 feat: adding LatestByErr helper 2026-03-02 16:06:51 +01:00
Samuel Berthe 2e0b3a19c9 feat: adding EarliestByErr helper 2026-03-02 16:06:51 +01:00
Samuel Berthe 32dce47128 feat: adding MinIndexByErr helper 2026-03-02 16:06:51 +01:00
Samuel Berthe bef45080d4 feat: adding MaxIndexByErr helper 2026-03-02 16:06:51 +01:00
Samuel Berthe 1db8f69a48 feat: adding KeyByErr helper 2026-03-02 16:06:51 +01:00
Samuel Berthe fadc3aa9d5 feat: adding MaxByErr helper 2026-03-02 16:06:51 +01:00
Samuel Berthe 1342d124d5 feat: adding PartitionByErr helper 2026-03-02 16:06:51 +01:00
Samuel Berthe 1da649cc26 feat: adding WithoutByErr helper 2026-03-02 16:06:51 +01:00
Samuel Berthe 0950850fe2 feat: adding GroupByMapErr helper 2026-03-02 16:06:51 +01:00
Samuel Berthe c9783b717b feat: adding MinByErr helper 2026-03-02 16:06:51 +01:00
Samuel Berthe 75474ff444 feat: adding GroupByErr+CountByErr helper 2026-03-02 16:06:51 +01:00
Samuel Berthe 153f867680 feat: adding MeanByErr helper 2026-03-02 16:06:51 +01:00
Samuel Berthe b0b34ffc94 feat: adding UniqByErr helper 2026-03-02 16:06:51 +01:00
Samuel Berthe 788fb2997c feat: adding OmitByErr helper 2026-03-02 16:06:51 +01:00
Samuel Berthe e9037c6e8c feat: adding ProductByErr helper 2026-03-02 16:06:51 +01:00
Samuel Berthe 2fac7c49dd feat: adding PickByErr helper 2026-03-02 16:06:51 +01:00
Samuel Berthe 361866b4d4 feat: adding ReduceRightErr helper 2026-03-02 16:06:51 +01:00
Samuel Berthe 993b074a87 feat: adding MapToSliceErr helper 2026-03-02 16:06:51 +01:00
Samuel Berthe 20d76196f2 feat: adding ReduceErr helper 2026-03-02 16:06:51 +01:00
Samuel Berthe 12e2b4ceb4 feat: adding SumByErr helper 2026-03-02 16:06:51 +01:00
Samuel Berthe f69cbe70f1 feat: adding MapEntiesErr helper 2026-03-02 16:06:51 +01:00
Samuel Berthe 75d813d292 feat: adding FlatMapErr helper 2026-03-02 16:06:51 +01:00
Samuel Berthe ec67399cd4 feat: adding MapErr helper 2026-03-02 16:06:51 +01:00
Samuel Berthe b1263d4a41 feat: adding MapValuesErr helper 2026-03-02 16:06:51 +01:00
Samuel Berthe d4146ceb18 feat: adding MapKeysErr helper 2026-03-02 16:06:51 +01:00
Samuel Berthe 14fff24f53 doc: fix simd doc 2026-02-28 16:11:07 +01:00
Samuel Berthe 578bfa9ee7 doc: fix sidebar 2026-02-28 02:29:57 +01:00
Samuel Berthe c767d0d8ca doc: fix sidebar 2026-02-28 02:25:49 +01:00
d-enk 68f827d9bf perf: optimize Substring to work directly with strings instead of converting to runes (#822)
* perf: optimize Substring to work directly with strings instead of converting to runes

- Rewrite Substring to iterate over string bytes directly, avoiding full []rune conversion
- Improve performance for long strings by only processing necessary portions
- Add comprehensive test cases for Unicode handling, invalid UTF-8, and edge cases
- Add BenchmarkSubstring to measure performance improvements
- Improve documentation with detailed parameter descriptions
- Handle invalid UTF-8 sequences by converting to []rune when needed

Bencstat:

                   │    old.txt    │               new.txt               │
                   │    sec/op     │    sec/op     vs base               │
Substring/{10_10}-4    558.85n ±  9%   39.75n ± 10%  -92.89% (p=0.000 n=8)
Substring/{50_50}-4    783.10n ±  6%   85.15n ±  5%  -89.13% (p=0.000 n=8)
Substring/{50_45}-4    773.30n ±  3%   126.5n ±  7%  -83.65% (p=0.000 n=8)
Substring/{-50_50}-4   794.00n ±  2%   177.6n ±  7%  -77.63% (p=0.000 n=8)
Substring/{-10_10}-4   542.85n ± 20%   41.82n ±  6%  -92.30% (p=0.000 n=8)
geomean               680.4n         79.52n        -88.31%

                   │  old.txt   │               new.txt                │
                   │    B/op    │   B/op    vs base                    │
Substring/{10_10}-4    432.0 ± 0%   0.0 ± 0%  -100.00% (p=0.000 n=8)
Substring/{50_50}-4    480.0 ± 0%   0.0 ± 0%  -100.00% (p=0.000 n=8)
Substring/{50_45}-4    464.0 ± 0%   0.0 ± 0%  -100.00% (p=0.000 n=8)
Substring/{-50_50}-4   480.0 ± 0%   0.0 ± 0%  -100.00% (p=0.000 n=8)
Substring/{-10_10}-4   432.0 ± 0%   0.0 ± 0%  -100.00% (p=0.000 n=8)

                   │  old.txt   │                new.txt                 │
                   │ allocs/op  │ allocs/op   vs base                    │
Substring/{10_10}-4    2.000 ± 0%   0.000 ± 0%  -100.00% (p=0.000 n=8)
Substring/{50_50}-4    2.000 ± 0%   0.000 ± 0%  -100.00% (p=0.000 n=8)
Substring/{50_45}-4    2.000 ± 0%   0.000 ± 0%  -100.00% (p=0.000 n=8)
Substring/{-50_50}-4   2.000 ± 0%   0.000 ± 0%  -100.00% (p=0.000 n=8)
Substring/{-10_10}-4   2.000 ± 0%   0.000 ± 0%  -100.00% (p=0.000 n=8)

* Enhance substring documentation with Unicode details

Returns a substring starting at the given offset with the specified length. Supports negative offsets; out-of-bounds are clamped. Operates on Unicode runes (characters) and is optimized for zero allocations.

---------

Co-authored-by: Samuel Berthe <dev@samuel-berthe.fr>
2026-02-27 22:19:20 +01:00
Samuel Berthe ac8295b68a style(simd): rename sse to avx (#821)
* style(simd): rename sse to avx

* fix(exp,simd): apply the right avx512 constraints to a few methods

* fix(exp,simd): apply the right avx512 constraints to a few methods
2026-02-26 22:08:53 +01:00
d-enk c49f84658a perf: lazy it.Reverse iteration instead of in-place mutation (#814)
Replace mutable.Reverse() with lazy iteration from end.
This avoids unnecessary array mutation and reduces overhead.
2026-02-25 20:59:44 +01:00
d-enk b9c84bc078 perf: optimize Zip and ZipBy functions (#818)
- Replace Nth() with NthOrEmpty() to avoid unnecessary error allocation on miss
- Change make(0, size) + append to make(size) + direct assignment
- Use uint for loop indices
- Remove temporary variables in ZipBy functions

This reduces overhead from append operations and structure creation,
similar to the Zip5Copy2 optimization pattern.

Reduces code size: +174/-242 lines
2026-02-25 20:57:04 +01:00
d-enk b27b00635d perf: avoid unnecessary error allocation in NthOr, NthOrEmpty (#817)
Extract core logic into sliceNth/seqNth func returning (T, bool) instead of (T, error).

NthOr and NthOrEmpty now use these directly,
avoiding fmt.Errorf allocation when nth is out of bounds.
2026-02-25 20:50:51 +01:00
d-enk b0b5cc3adf perf: preallocate result slice in RangeWithSteps (#820)
- RangeWithSteps now preallocates result slice using math.Ceil for better performance
- Fix edge cases for floating point values with small steps
- Add test cases for float and custom type validation
- Rename TestRangeClose → TestRangeWithSteps for consistency
- Simplify ChunkEntries chunk count calculation using ((count-1)/size)+1 formula
2026-02-25 20:48:26 +01:00
Samuel Berthe 41cfa4c55a chore(ci): use last go version with codeql 2026-02-25 20:25:36 +01:00