TODO-FIXME:在Java 8的Integer类中?
在阅读Java 8的整数类时,我遇到了以下FIX-ME:(第379行)
// TODO-FIXME: convert (x * 52429) into the equiv shift-add
// sequence.
整个评论内容如下:
// I use the "[invariant division by multiplication][2]" trick to
// accelerate Integer.toString. In particular we want to
// avoid division by 10.
//
// The "trick" has roughly the same performance characteristics
// as the "classic" Integer.toString code on a non-JIT VM.
// The trick avoids .rem and .div calls but has a longer code
// path and is thus dominated by dispatch overhead. In the
// JIT case the dispatch overhead doesn't exist and the
// "trick" is considerably faster than the classic code.
//
// TODO-FIXME: convert (x * 52429) into the equiv shift-add
// sequence.
//
// RE: Division by Invariant Integers using Multiplication
// T Gralund, P Montgomery
// ACM PLDI 1994
//
我无法想象我应该为此担心,因为这已经存在了很长一段时间。
但是,有人可以阐明这个FIX-ME的含义以及是否有任何副作用吗?
附注:
- 我看到这已经从JDK 10中删除了
- 链接中引用的论文似乎没有直接解决该问题。