A few years back, when I posted an analysis of how TValue is very slow, it prompted a lot of response from the community. Various people ran their own benchmarks, and started working on building or optimizing their own meta-value types. Some people are even still working on that today. But one of the most interesting things was Robert Love’s response. He looked at the TValue code and found a way that it could be optimized for the common case to speed things up. Continue reading ‘The next RTTI bottleneck’ »
Posts tagged ‘RTTI’
Way back at the start of this year, I wrote about how I’d been working on a new Object Pascal-based script engine built around Delphi’s extended RTTI system. And then it got real quiet, because more immediate concerns took priority for me. But I’ve gotten to the point in my game engine development where I really need to put in the scripting system, so I spent the last couple weeks finishing up the implementation and tuning the performance a little, and now I’ve got an alpha version ready. If anyone would like to try it out, they can find it on Google Code.
About a year and a half ago, I reported on how slow the original implementation of TValue in Delphi 2010 was, touching off a storm of comments and various other blog posts as other Delphi community members conducted similar experiments. One thing that came out of it was a suggestion by Robert Love on how to improve performance by adding code to optimize for the most common cases. Continue reading ‘XE2: TValue is much faster now’ »
I wrote my last post about enabling booleans in Firebird after several hours of poking around in database code trying to get my query to execute without errors. Once it worked, everything seemed great. But I missed an important step: I hadn’t tried to write anything back to the database yet.
Firebird is a great database, but it’s got one really irritating drawback: no native support for the boolean type. The standard solution to this issue is to create a BOOLEAN domain as a special restricted version of a smallint, and then make your database driver output the correct type.
The first part is easy. The second, not so much, if you want to use DBExpress. This really should be handled internally as a special case inside the DBX driver. Unfortunately neither Embarcadero nor Chau Chee Yang, maker of the alternative dbExpress Firebird driver, has released the source to their drivers, neither driver handles the BOOLEAN domain, and neither driver has any sort of callback/event handler that you can set up to intercept and modify the schema of a query result. But I’m not gonna let a little thing like that stop me! Continue reading ‘Adding boolean support to Firebird+DBX’ »
Over the past couple weeks, I’ve been working on refining and testing my RTTI generation and the scripting system I’ve been building on top of it, which I’ve decided to call RTTI Script. I think I’m finally starting to get something ready for public consumption. I set up a Google Code repository this morning for RTTI Script, but so far all it contains is the RTTI generation code. The actual compiler and script executor still need some work. Continue reading ‘RTTI Generation code now available’ »
A few years back, I ran across this post by Hallvard Vassbotn. (It’s a shame he stopped blogging, because he always had some very interesting stuff about the technical details of how stuff in Delphi works.) At the bottom was a paragraph that really fascinated me:
On a more technical level it suffices to say that they use custom and extremely compact and fast data structures, tricks and hacks to be able to represent millions and millions of objects within the constraints of a 32-bit Windows system. Throw in the use of Physical Address Extensions, storing per-class information in “virtual” class vars to reduce object instance size, creation of classes and their VMTs dynamically at runtime (!!), pointer packing, multithreading, the list just goes on and on.
One of the biggest complaints about the extended RTTI introduced in Delphi 2010 is the way it adds so much to the size of your EXE. Well, in a recent StackOverflow answer, Barry Kelly hinted that the format of the basic RTTI structures in TypInfo.pas are “more likely to change from version to version now that it has a much higher level abstraction in the Rtti unit.” Continue reading ‘Smaller, cleaner RTTI coming?’ »
This week’s just getting started, and it’s already had more than enough awesomeness to pack into a typical month. The new version of Delphi came out yesterday. Metroid: Other M and The Way of Kings, a new Brandon Sanderson book, were both released today. (I have a feeling I’m going to be more distracted than usual for a while…) But as awesome as Metroid games and anything by Sanderson tend to be, (if you’re into fantasy at all, check out Elantris and Mistborn and prepare to be blown away,) this is a programming blog, and I’m supposed to be talking about Delphi. So here’s the good, the bad, and the annoying about my first impressions with Delphi XE.
A lot of the UI design for the TURBU editor is based on data-aware controls bound to client datasets. I was trying to build a new form this morning that required me to filter one of the datasets. Problem is, that would break other things that expected it not to be filtered. Well, that’s not such a big problem, because TClientDataset has an awesome method called CloneCursor that lets you set up a second client dataset that shares the first one’s data store, but with independent view settings. So I used a cloned dataset, and immediately got an exception when I tried to run. The control I was using couldn’t find the field.