Book a Demo

Author Topic: Speeding up automation  (Read 4012 times)

albinofrenchy

  • EA User
  • **
  • Posts: 21
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
Speeding up automation
« on: February 04, 2008, 02:02:10 pm »
I'm working on a project that essentially requires a complete transformation of a model, and right now it is taking an excessive amount of time to do; the culprit appears to be the Update functions. Combined they account for more than 75% of the total runtime(of our code, this is relevant later). This is even with the repository flags set. My question is, is there anyway to further speed it up? Worst case scenario, is it possible to access the underlying database ourselves for optimization?

Also; I've noticed that despite turning off UI updates, the tree view still is updated. Is there anyway to stop that? Here are my Repository settings:

           this.Repository.SuppressEADialogs = true;
           this.Repository.EnableUIUpdates = false;
           this.Repository.EnableCache = true;
           this.Repository.BatchAppend = true;

Thanks,
J


«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: Speeding up automation
« Reply #1 on: February 04, 2008, 02:12:37 pm »
I have not timed the 'suppression' methods lately, but in past had my suspicions about how much they helped.

You can access the underlying database. However this is largely (almost completely) undocumented, and you are doing so at your own risk.

Some fields - mostly but not exclusively those that are either a BLOB 255 characters - are 'magic' strings. By this I mean that they contain various settings that are undocumented, and are subject to change. So you will have to verify that your code still works after new releases.

Now for some good news...

The EA schema has remained fairly stable for some time, and older 'magic' entries don't seem to be replaced by new stuff. Most of the time your code will work when a new version comes out. Add to that the fact that the EA schema is built without triggers or stored procedures; it is however, quite tolerant if you want to add your own. You can even add fields to the table definitions - you might want to avoid going that far though.

To get you started, the Repository class exposes a ConnectionString property that gives you the settings EA is currently using. Except for the Desktop version EA opens models for shared access, so you can use this string if you want. Remember that you can open an EAP file as if it were a DBMS repository, so this property can be useful at that level as well.

There's some good information buried in the forum. You'll have to search (really hard) for it, but that would be time well spent.

HTH, David
No, you can't have it!

albinofrenchy

  • EA User
  • **
  • Posts: 21
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
Re: Speeding up automation
« Reply #2 on: February 08, 2008, 02:19:20 pm »
I'm glad I'm not alone in not trusting the suppression stuff.

At the threat of undocumented database queries with magic strings, I went ahead and just wrapped all the base objects so that they update only when absolutely needed. I have a funny feeling this is still slower than direct DB management; but it'll have to do for now.

Thanks though, this gives me a little more insight into how EA does its work in the background.

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: Speeding up automation
« Reply #3 on: February 08, 2008, 03:09:54 pm »
Quote
...
At the threat of undocumented database queries with magic strings, I went ahead and just wrapped all the base objects so that they update only when absolutely needed. I have a funny feeling this is still slower than direct DB management; but it'll have to do for now...

J,

I'm firmly in your camp. I have found the performance to be acceptable most of the time, and the risk of directly tweaking the database rarely worth incurring.

That said, sometimes it is straightforward to manipulate the data, so that can pay off. These situations tend to be clearly bounded though.

As for reading the database directly, this often pays off. Still, remember that you can have EA do searches for you, and you can call these from automation.

David
No, you can't have it!