tag:blogger.com,1999:blog-29331675.post2867502157518783510..comments2024-03-05T17:37:00.995+01:00Comments on The Delphi Geek: Speed comparison: Variant, TValue, and TOmniValuegabr42http://www.blogger.com/profile/06903558857617342477noreply@blogger.comBlogger8125tag:blogger.com,1999:blog-29331675.post-23573680952610136642018-11-29T11:22:56.812+01:002018-11-29T11:22:56.812+01:00CPU: i5-4430
Delphi Berlin
TValue: 2928ms
Variant:...CPU: i5-4430<br />Delphi Berlin<br />TValue: 2928ms<br />Variant: 3820ms<br /><br />Delphi 10.2<br />TValue: 2908ms<br />Variant: 3921ms<br />Anonymoushttps://www.blogger.com/profile/04607070122058766254noreply@blogger.comtag:blogger.com,1999:blog-29331675.post-14995610821619220022016-04-29T12:12:40.556+02:002016-04-29T12:12:40.556+02:00Delphi Seattle, current version of libraries:
Var...Delphi Seattle, current version of libraries:<br /><br />Variants: 1263<br />TValue: 2017<br />TAnyValue: 1137<br />TOmniValue: 4166<br />TVariableRec: 798Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-29331675.post-24459669795095278622012-02-22T14:07:10.423+01:002012-02-22T14:07:10.423+01:00I think you are wrong about Variant type. You shou...I think you are wrong about Variant type. You should change benchmark of Variant type by direct casting it to TVarData and using VInteger member of structure assuming that only integer values are involved.<br />Here is my optimized version of Variant test, try it:<br />procedure TfrmBenchmark.TestVariant3(var benchRes: Integer);<br />var<br /> counter: Variant;<br /> i: Integer;<br />begin<br /> counter := Integer(0);<br /> for i := 1 to CBenchResult do<br /> TVarData(counter).VInteger := TVarData(counter).VInteger + 1;<br /> benchRes := counter;<br />end;AlWerewolfhttps://www.blogger.com/profile/02606095273852470185noreply@blogger.comtag:blogger.com,1999:blog-29331675.post-65210304476497802692011-02-18T14:45:25.787+01:002011-02-18T14:45:25.787+01:00@Eric: I've reconstructed my tested under XE a...@Eric: I've reconstructed my tested under XE and I'm getting similar results except that TOmniValue is only twice as fast as Variant.gabr42https://www.blogger.com/profile/06903558857617342477noreply@blogger.comtag:blogger.com,1999:blog-29331675.post-25485747052706123912011-02-17T02:24:18.915+01:002011-02-17T02:24:18.915+01:00Nice work! I'd be curious to know how this tes...Nice work! I'd be curious to know how this test compares when run on Delphi XE. I'm using Variants a lot in my UI stuff and am curious to know if they have seen optimizations.Eric Fortierhttps://www.blogger.com/profile/08133452128907919922noreply@blogger.comtag:blogger.com,1999:blog-29331675.post-43332979734238558032010-03-23T23:31:13.084+01:002010-03-23T23:31:13.084+01:00After having read your great article, I've tri...After having read your great article, I've tried to rewrite the _CopyRecord function of the system.pas unit, with speed in mind.<br /><br />Here is the resulting code, which should work from Delphi 7 up to 2009: http://blog.synopse.info/post/2010/03/23/CopyRecord-faster-proposalAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-29331675.post-57256969639627700042010-03-16T14:06:14.286+01:002010-03-16T14:06:14.286+01:00Huh, as always great and in depth article. I only ...Huh, as always great and in depth article. I only scratched the surface and didn't have time to dig further. Well now I won't have to :)<br /><br />I didn't know inlining contributes so much to the result.runnerhttps://www.blogger.com/profile/10898827626049604220noreply@blogger.comtag:blogger.com,1999:blog-29331675.post-90843387096670950952010-03-16T13:45:41.889+01:002010-03-16T13:45:41.889+01:00Another post on that topic: TValue and other “Vari...Another post on that topic: <a href="http://www.cromis.net/blog/2010/03/tvalue-and-other-variable-like-implementation-tests/" rel="nofollow">TValue and other “Variants” like implementation tests</a>gabr42https://www.blogger.com/profile/06903558857617342477noreply@blogger.com