The textbook choice B=sqrt(n) for square-root decomposition is asymptotically natural, but it is not always the fastest implementation choice. We study block-size autotuning as a reproducible algorithm-engineering problem and show that a learned workload model can improve over fixed sqrt(n) on the tested implementation. Under repeated grouped cross-validation, the best policy is a full-feature KNN-9 model that reduces mean regret from 1.2882 to 1.0646 and yields a paired geometric-mean speedup of 1.151x. A confidence gate retains most of that gain while reducing slowdowns. A family-free full-observation follow-up remains better than fixed blocking, which suggests that the model is learning from workload statistics rather than memorizing labels. In contrast, short-prefix variants do not produce a successful low-overhead online tuner in the current prototype. External validation is selective but supportive: Zipf-Hotspot is the strongest out-of-distribution case, and a six-window Baleen follow-up still improves over fixed blocking. Overall, block-size choice is workload aware and platform aware, and the fixed sqrt(n) rule leaves substantial performance on the table.
翻译:教科书选择的B=sqrt(n)在平方根分解中具有渐近自然性,但并非总是最快的实现选择。我们将块大小自动调优作为可复现的算法工程问题进行研究,并表明基于学习的工作负载模型可以在测试实现中优于固定的sqrt(n)方案。在重复分组交叉验证下,最佳策略是全特征KNN-9模型,该模型将平均遗憾度从1.2882降至1.0646,并实现了1.151倍的配对几何平均加速。置信门控机制在保留大部分增益的同时减少了性能下降。无族别全观测后续方法仍优于固定分块策略,这表明模型是从工作负载统计信息中学习而非记忆标签。相反,短前缀变体在当前原型中未能成功构建低开销的在线调优器。外部验证虽具选择性但具有支撑性:Zipf热点分布是最强的分布外案例,而六窗口Baleen后续方法仍优于固定分块。总体而言,块大小选择具有工作负载感知和平台感知特性,固定sqrt(n)规则会显著损失性能。