A developer experiment with HarmonyOS 7 FAST Kit tested two system-provided algorithms: natural-language sorting and a 4,096-point fast Fourier transform (FFT). Both required Native C interfaces and a NAPI bridge from ArkTS. The reported results come from a Mate 90 Pro simulator, not a physical device, using DevEco Studio 26.0.0.851, the HarmonyOS 26.0.0 Release SDK and HarmonyOS 7.0.0.107.

Natural sorting: faster in this comparison
The sorting test compared FAST Kit’s HMS_FAST_Algo_NaturalSort with an ArkTS Intl.Collator baseline across lists of 1,000, 10,000 and 100,000 entries. For 10,000 entries, the reported time fell from 146 ms to 20 ms. In a separate deployment run, the baseline and FAST Kit times were 51/262/2,381 ms and 4/30/203 ms, respectively, across the three list sizes. The article reports matching result hashes in every run.

The observed 7.3×–13.3× speedups should not be equated with a 60%–70% improvement figure cited in the source: the baselines differ, and this experiment also compares different execution paths. For 1,000 entries, the reported absolute difference was 37 ms; the case for switching depends on list size and integration cost.

FFT: the transform worked, but plotting needed attention
The second test used libfast_dsp.so to transform 4,096-point simulated signals sampled at 4,096 Hz. For a three-tone signal generated at amplitudes of 0.60, 0.30 and 0.15, the detected values were 0.600, 0.300 and 0.150. The article reports roughly 0.02–0.03 ms for a single 4,096-point FFT in its simulator test. That figure does not cover the full cost of transferring data and drawing the spectrum, or establish performance on a physical device.


An initial chart showed no spectral bars even though peak detection found 50, 120 and 300 Hz. The article attributes this to the chart’s sampling of a spectrum whose energy fell into individual frequency bins—not to a failed FFT. Applying a Hann window made the peaks visible with that plotting approach, while requiring amplitude compensation. Windowing, single-sided spectrum conversion and amplitude calibration remain application responsibilities.

Integration limits
Both tested capabilities use Native C interfaces rather than direct ArkTS calls. Natural sorting requires UTF-8 string pointers and an HMS_FAST_SortData descriptor whose sizeOf is sizeof(char*); the FFT length must be a power of two. The experiment also encountered two build requirements: compatibleSdkVersion had to use the "26.0.0" format, and the FAST Kit libraries had to be linked from the HMS sysroot rather than the OpenHarmony sysroot.

The libraries are supplied by the system runtime, not bundled in the application package. The article advises testing on physical devices at the minimum supported version and preparing fallbacks—for example, Intl.Collator for sorting or a software FFT—because loading the libraries on an older system can fail. Its central lesson is to verify equivalent results first, then measure end-to-end performance on target devices before adopting the new path.

Source: infoq.cn (originally published 2026-11-12 10:20 UTC+8)
