-
Notifications
You must be signed in to change notification settings - Fork 13
Comparing changes
Open a pull request
base repository: mljs/spectra-processing
base: xyArrayAlign
head repository: mljs/spectra-processing
compare: main
- 12 commits
- 51 files changed
- 4 contributors
Commits on Sep 10, 2026
-
Configuration menu - View commit details
-
Copy full SHA for 01a1b16 - Browse repository at this point
Copy the full SHA 01a1b16View commit details -
Configuration menu - View commit details
-
Copy full SHA for 7c8ac24 - Browse repository at this point
Copy the full SHA 7c8ac24View commit details -
Configuration menu - View commit details
-
Copy full SHA for 5ebb471 - Browse repository at this point
Copy the full SHA 5ebb471View commit details -
Configuration menu - View commit details
-
Copy full SHA for 6890764 - Browse repository at this point
Copy the full SHA 6890764View commit details -
feat: add xGetSortOrder and xGetApproximateSortOrder
Radix sort over the bits of each double, so the cost is a fixed number of linear passes instead of n log n comparisons. Measured against a comparator sort of an index array (benchmark.js, minSamples 30, random doubles, ns per element, node 26): n comparator xGetSortOrder xGetApproximateSortOrder 50 69.8 78.8 (0.9x) 46.3 (1.5x) 1000 122.5 25.4 (4.8x) 13.9 (8.8x) 100000 230.9 24.0 (9.6x) 9.3 (24.8x) 1000000 290.4 23.0 (12.6x) 9.6 (30.3x) xGetSortOrder keys on all 64 bits and orders exactly, NaN, infinities, subnormals and the two zeros included. xGetApproximateSortOrder keys on the high word only, halving the passes, and orders to 20 bits of relative precision. The digit is 8 bits below 65536 values and 16 above, which keeps the O(radix) counting pass from dominating short arrays. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>Configuration menu - View commit details
-
Copy full SHA for f087036 - Browse repository at this point
Copy the full SHA f087036View commit details -
feat: add xDoubleTypedArrayLength
A typed array cannot be resized, so a buffer of unknown size has to allocate a longer one and copy into it. Doubling keeps the total cost of filling it linear, and an empty array becomes one element long so that doubling makes progress. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Configuration menu - View commit details
-
Copy full SHA for 3b5f34d - Browse repository at this point
Copy the full SHA 3b5f34dView commit details -
feat: add xyArrayAlignByIntensity and xyArrayMergeByIntensity
Align and merge centroided spectra around the most intense peaks: the strongest peak of the whole set opens a slot and takes every peak within delta of it, the strongest of the rest opens the next, and so on. A slot therefore never grows wider than 2 * delta, where a chain of close neighbours can. Merge keeps only the common peaks, so it scales where the dense alignment matrix does not. mergeSortedXY picks its strategy from the number of spectra: a binary heap costs O(log k) per point, ordering the concatenated points costs the same whatever k is, and the two meet at thirty spectra (benchmark/mergeSortedXY.ts, 2M points, ns per point): spectra heap sorting 5 13.6 23.2 15 21.1 23.8 30 25.9 23.9 100 33.1 21.7 1000 55.3 22.1 5000 67.8 23.4 30000 spectra of 1000 peaks merge into 7141 slots in 2.1s. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>Configuration menu - View commit details
-
Copy full SHA for 9c11817 - Browse repository at this point
Copy the full SHA 9c11817View commit details -
chore: add a benchmark for the shapes xGetSortOrder can order
node 26 / bun 1.3, ns per point at n = 1M: permuting x and y 555 -> 29, ordering points 445 -> 28, the nth largest y 70 -> 24, sorted values 70 -> 20.
Configuration menu - View commit details
-
Copy full SHA for 9087fd7 - Browse repository at this point
Copy the full SHA 9087fd7View commit details -
perf: order xySortX and xyObjectSortX through xGetSortOrder
ns per point on node, from n = 1000 to n = 1M: xySortX 118 -> 41 and 555 -> 29, xyObjectSortX 102 -> 42 and 445 -> 28. Below 256 values the comparator still wins, so it stays.
Configuration menu - View commit details
-
Copy full SHA for 9c744b6 - Browse repository at this point
Copy the full SHA 9c744b6View commit details -
Configuration menu - View commit details
-
Copy full SHA for e07ca79 - Browse repository at this point
Copy the full SHA e07ca79View commit details
Commits on Sep 11, 2026
-
Configuration menu - View commit details
-
Copy full SHA for 4d0c22a - Browse repository at this point
Copy the full SHA 4d0c22aView commit details
Commits on Sep 14, 2026
-
Configuration menu - View commit details
-
Copy full SHA for 0d5e0e2 - Browse repository at this point
Copy the full SHA 0d5e0e2View commit details
This comparison is taking too long to generate.
Unfortunately it looks like we can’t render this comparison for you right now. It might be too big, or there might be something weird with your repository.
You can try running this command locally to see the comparison on your machine:
git diff xyArrayAlign...main