简体   繁体   English

Delphi XE2 的 FastString 替代品

[英]FastString Alternatives to Delphi XE2

When I asked this question a while ago, the FastString unit came to solve my problem.不久前我问这个问题时,FastString 单元来解决我的问题。

Now I am starting to migrate my software from D7 to XE2.现在我开始将我的软件从 D7 迁移到 XE2。 My question is, what alternatives do I have now since it appears that FastString will no longer solve the problem?我的问题是,既然 FastString 似乎不再解决问题,我现在有什么替代方案?

...or, more optimistically, does Delphi itself solves this performance issues? ...或者,更乐观地说,Delphi 本身是否解决了这个性能问题?

A Lot of the FastCode routines have been included in recent Delphi, so you might not need 3rd party libraries anymore.最近的 Delphi 中包含了许多 FastCode 例程,因此您可能不再需要第 3 方库。
Try with the stock RTL/VCL, then see if you still have a problem and what would be the best solution to solve it in the new environment.尝试使用现有的 RTL/VCL,然后查看是否仍有问题,以及在新环境中解决该问题的最佳解决方案是什么。

Being concerned about the impact of Unicode on the famously excellent string performance in Delphi (which FastStrings elevated to an extreme level), I undertook a series of comparative benchmarking tests comparing Delphi 7, 2007, and 2009 soon after 2009 was released and these tests included some FastStrings comparisons.由于担心 Unicode 对 Delphi 中著名的出色字符串性能的影响(FastStrings 将其提升到了一个极端的水平),在 2009 发布后不久,我进行了一系列对比 Delphi 7、2007 和 2009 的基准测试,这些测试包括一些 FastStrings 比较。

The conclusions were that despite the fact that yes, the RTL has seen some significant improvements that negate the need for FastStrings, there are however (or were, at the time of Delphi 2009) some potential "gotcha's" waiting to catch you out if you simply and naively assumed that everything was sweet-as in the Delphi 2009+ garden.结论是,尽管 RTL 已经看到了一些显着的改进,否定了对 FastStrings 的需求,但是(或者在 Delphi 2009 的时候)有一些潜在的“陷阱”在等着你,如果你简单而天真地假设一切都是甜蜜的——就像在 Delphi 2009+ 花园中一样。

And ultimately, the overhead of Unicode eats up a lot of the gains from 2009+ (which is not something that FastStrings could ever have worked around as a lot of the boosts in FastStrings relied on reliable artefacts of ANSI strings specifically that do not apply to Unicode).最终,Unicode 的开销消耗了 2009 年以上的很多收益(这不是 FastStrings 可以解决的问题,因为 FastStrings 中的很多提升依赖于 ANSI 字符串的可靠人工制品,特别是不适用于统一码)。

It is worth noting that I haven't revisited these tests since, and it might be interesting to repeat the exercise now taking into account Delphi 2010, XE and XE2 to see if any further improvements have been made in these releases.值得注意的是,从那以后我就没有重新审视这些测试,考虑到 Delphi 2010、XE 和 XE2,现在重复练习可能会很有趣,看看这些版本是否有任何进一步的改进。

I may undertake this once I have finished preparing the Smoketest framework - that I used to conduct the tests initially - for release, by way of providing an example.一旦我完成了 Smoketest 框架的准备工作——我最初用来进行测试——我可以通过提供一个例子来进行发布。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM