Marco Tech Blog

Another beta Tiburon YouTube video, covering Unicode. This time I'm showing the UniApiSpeed example, that times 10,000 invocations of the GetUserName and SetWindowText API calls. The same exact program (which is interesting it itself) is compiled in a beta version of Tiburon (things might change in the final version) and in Delphi 7, the the video shows the result... which is very positive at least for one of the two cases.

This is the fifth (and final) video of this series, which covers the example in the first chapter of my coming Delphi handbook focused on Tiburon. I'll get more videos out, but probably after I take some time off in the coming weeks... as for now I'm fully focused on the book.

PS. There is my dog barking at the very end of the video... but I decided to let that audio in, and this is the second "appearance" of my dog after he barked in my open mike during one of the CodeRage events.

2 Comments

Tiburon Unicode Video 5

Hi Marco, thank you for your very interesting videos.
I'm trying to read about Tiburon as much as possible,
and I find that one serious thing that needs attention
is overlooked. More precisely, surrogate pairs.
Developers need to understand that they can't simply
do MyString[Index]:='A' anymore because if they hit a
surrogate pair element, the whole string will be
invalidated. That is serious. People should not think
that their code will never meet a surrogate pair.
Well-written code must definitely be able to cope with
that from the ground up.
As far as I understand, there are two ways to cope
with surrogate pairs: the proper way, to use functions
IsHighSurrogate and IsLowSurrogate and treat the pair
"manually" with several if-elses, and the lazy way, to
use USC4String and USC4Char types, which should make
slower code because of additional conversions.
The first method is not always better because if the
programmer is lazy to make it properly I think it
would be better to have a slower, but more foolproof
code by using USC4String. Can you please make some
benchmarks with a significant amount of text in a
variable to see how much is the speed impairment
during conversions between UnicodeString and USC4String?
Thank you!

Comment by Alexander
[]
on August 8, 22:00

Tiburon Unicode Video 5

I was prepared to believe that there might be SOME
improvement, as claimed, at the Windows API, but I
didn't think it was likely to be significant as the
performance of Windows API calls isn't - typically,
ime - where concerns about performance arise.
Those concerns - where they involve string handling -
more typically revolve around the internal processes
of an application, not the passing of strings across
the Windows API, and I was highly dubious that any
gains in API efficiency would offset the impact that
Unicode would have in those areas.
But now it would seem that there is NO performance
improvement in API calls, and in some cases a
performance degradation!
This has been an interesting series of videos, but I
think it needs at least one more, to complete the
performance impact picture, showing a similar
performance comparison of some typical application
string handling code.
Perhaps:
- sorting a string list
- building a string via concatentation
- removing/replacing sub-strings
- in the Tiburon version, perhaps show what impact
the StringBuilder class has on these operations
I would also be interested to know if the FastStrings
library can be used in Tiburon.

Post Your Comment

A blog about Delphi programming, Embarcadero, XML, Web 2.0,
JavaScript, and anything else Marco is working on
and has worked on in the past.
Site content is copyright
Marco Cantu' 2005-2016. Powered by Bootstrap and
Delphi.