[This is a guest post, written by Primož Gabrijelčič, www.thedelphigeek.com]
One thing interested me since I started reading Eric’s series on string concatenation performance – how would different memory managers compare in a multi-threaded scenario. Today I decided to spend an hour finding out…
edit 18/11: the tests were run with debug mode, which affected TTextWriter very negatively (TWOBS is also affected a negatively, but less, and StringBuilder and Trivial aren’t affected much). I’ll be repeating tests with more memory managers and in more stable conditions in the next few weeks.
By popular request, here is the source code used for the previous String benchmarks StringConcatBench.zip, essentially to test alternative memory managers.
The source is nothing complicated as you will see, just a set of simple function with the test cases, and a couple function that measure run times.
After looking at String concatenation and String Building in Delphi, and as a conclusion, it’s time to have a brief look at what happens in multi-threaded settings, such as in a server pushing JSON, XML or some other text data.
Or a dozen. Or a whole flock.
As a followup to the String Concatenation article, let’s take a look at a less trivial case: what if instead of concatenating a couple strings, you want to concatenate a few hundred?
Sounds like a task at which TStringBuilder should excel, but one should never assume, and always measure.
You may all know about String concatenation in Delphi, but do you know about the implicit String variables the compiler may create for you?
Along with the implicit variables come implicit exception frames, and a whole lot of hidden stack juggling, which can quickly become hidden complexity bottlenecks.
The built-in time-stepping support for the upcoming release of SmartMS got an overhaul in the form of a now frame-rate oriented Game View component, and a simulation-oriented TMetronome time-stepper.
Chrome for Android 31 (currently in the beta channel) added the ability to add a web application to the home screen, which iOS fans will notice it had been available for years on their fruity phones.
Upgrading a SmartMS application to allow installing on the Android Home Screen is very straightforward.
As noted in a recent post, Unicode is not so straightforward. Namely claims of utf-16 being simpler than utf-8, or that you do not have to care about Unicode complexities.
Maybe that was the case ten years ago, but The Unicode jungle is much closer to home these days.
Here are a few dangers lurking in the not-so-dark shadows.
Work and processing classes are typically short-lived, created to perform one form of processing or another then freed. They can be simple collections, handle I/O of one kind of another, perform computations, pattern matching, etc.
When they’re used for simple workloads, their short-lived temporary nature can sometimes become a performance problem.