Author Topic: worse Addin performance with the 64bit version  (Read 2770 times)

flofsid

  • EA Novice
  • *
  • Posts: 9
  • Karma: +0/-0
    • View Profile
worse Addin performance with the 64bit version
« on: November 07, 2022, 06:39:20 pm »
Hi guys  :),

I tested my add-ins with the 64-bit version and noticed that the performance is worse compared to the 32-bit version.
Everything works, but it takes longer.

Can someone tell me what I can do about it? 
Thanks :)

Best regards
flofsid

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13288
  • Karma: +557/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: worse Addin performance with the 64bit version
« Reply #1 on: November 07, 2022, 06:49:03 pm »
Not sure what you can do, except to start profiling your add-ins to figure out where it slows down.

I have quite a bit of add-ins, and I haven't noticed a performance issue on 64bit. (no improvement either)

Geert

flofsid

  • EA Novice
  • *
  • Posts: 9
  • Karma: +0/-0
    • View Profile
Re: worse Addin performance with the 64bit version
« Reply #2 on: November 07, 2022, 07:24:00 pm »
My addin creates many elements and packages from xml files.

Reading the xml files is even faster with the 64bit version,
but creating the objects in the project browser takes twice as long as with the 32bit version.

So I think creating new objects is the problem.

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13288
  • Karma: +557/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: worse Addin performance with the 64bit version
« Reply #3 on: November 07, 2022, 07:30:35 pm »
Sometimes it helps to disable GUI updates while creating new elements.

If you can reliably demonstrate the issue between 32 bit and 64 bit, it might be worth to send a bug report to Sparx

Geert

Richard Freggi

  • EA User
  • **
  • Posts: 487
  • Karma: +18/-7
    • View Profile
Re: worse Addin performance with the 64bit version
« Reply #4 on: November 08, 2022, 02:43:03 pm »
For me add-in are running a little faster in EA 16 (*.qea) compared to EA13 (*.feap).  I use local repository on my hard disk.

flofsid

  • EA Novice
  • *
  • Posts: 9
  • Karma: +0/-0
    • View Profile
Re: worse Addin performance with the 64bit version
« Reply #5 on: November 08, 2022, 06:13:32 pm »
I've already tested a few things with the same xml File.

First the import into EA15 (*.eapx):
- Duration: 00:03:45
- CPU usage: 16%

Second the import into EA16 32bit (*.eapx):
- Duration: 00:03:41
- CPU usage: 16%

Third the import into EA16 64bit (*.qea):
- Duration: 00:07:53
- CPU usage: 5%

And last the import into EA16 32bit (*.qea):
- Duration: 00:08:01
- CPU usage: 5%

So the problem must be with the new (*.qea) repository

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13288
  • Karma: +557/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: worse Addin performance with the 64bit version
« Reply #6 on: November 08, 2022, 09:36:39 pm »
That's weird, my experience with .qea models on 64 bit is that they are much faster than .eap or SQL Server.

Maybe it depends on the type of actions?

Geert

flofsid

  • EA Novice
  • *
  • Posts: 9
  • Karma: +0/-0
    • View Profile
Re: worse Addin performance with the 64bit version
« Reply #7 on: November 09, 2022, 12:40:13 am »
For me that doesn't make much sense either and why do I only have 5% CPU usage with the .qea models?  ;D

Everything that has nothing to do with the EA Repository is also much faster, but creating new EA objects takes twice as long.

My Addin has to import a lot of elements, it can be up to 10,000 pieces.

Have you ever tried something similar with the new version?

Thank you for the answers Geert :)

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13288
  • Karma: +557/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: worse Addin performance with the 64bit version
« Reply #8 on: November 09, 2022, 01:27:28 am »
Have you ever tried something similar with the new version?

Not really, I guess I could see what my ExcelImporter does..

I'll report back later

Geert

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13288
  • Karma: +557/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: worse Addin performance with the 64bit version
« Reply #9 on: November 09, 2022, 02:04:40 am »
I did some tests with an excel file containing 500 lines having 55 classes and 445 attributes.
This is purely a create scenario. No updates where done.

EA v16.1.1620 (64 bit), Local SQL Server: 16 seconds
EA v16.1.1620 (64 bit), .qea file: 13 seconds

EA v16.1.1620 (32 bit), .eapx file: 48 seconds
EA v16.1.1620 (32 bit), Local SQL Server 42 seconds
EA v16.1.1620 (32 bit), .qea file 62 seconds

So for this case at least, the bitness seems to be the deciding factor, where 64 bit is a lot (x4) faster then 32 bit.

Geert

flofsid

  • EA Novice
  • *
  • Posts: 9
  • Karma: +0/-0
    • View Profile
Re: worse Addin performance with the 64bit version
« Reply #10 on: November 09, 2022, 07:22:44 pm »
Thanks for the test Geert :)

Does your ExcelImporter also create new EA.Elements and EA.Packages or did you just read out an Excel list?

Reading my xml files is also much faster with the 64bit version :)

but creating new EA.Elements and new EA.Packages is slower

my code

Code: [Select]
Repository.EnableUIUpdates = false;

//Create Package
EA.Package newPackage = (EA.Package)collection.AddNew(name, "");
newPackage.Update();
newPackage.Element.Stereotype = Library.EA.Types.InformationType;
newPackage.Update();

foreach (EA.TaggedValue tag in newPackage.Element.TaggedValues)
{
  foreach (EaProperty property in item.Properties)
  {
     if (tag.Name == property.Name)
     {
       tag.Value = property.Value;
       tag.Update();
     }
   }
}

newPackage.Element.TaggedValues.Refresh();


//Create Element
EA.Element newElement = (EA.Element)collection.AddNew(item.Name, item.EaType);
collection.Refresh();
newElement.Update();

foreach (EA.TaggedValue tag in newElement.TaggedValues)
{
  foreach (EaProperty property in item.Properties)
  {
     if (tag.Name == property.Name)
     {
       tag.Value = property.Value;
       tag.Update();
     }
   }
}

newElement.TaggedValues.Refresh();
« Last Edit: November 09, 2022, 07:24:35 pm by flofsid »

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13288
  • Karma: +557/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: worse Addin performance with the 64bit version
« Reply #11 on: November 09, 2022, 07:49:31 pm »
It creates Elements and attributes, no packages.

Your code looks pretty much OK, except for the Refresh() calls.

They are completely not necesarry, and especially for larger imports, they could prove to be a major cause for slowdowns.
What you are basically asking EA is to clear the collection and reload it from the database.
The only reason why you would want to do that is if you are looping said collection after adding or removing stuff from it.
This method call should only be used where necesarry right before reading the collection.

The collection is getting larger and larger, and for each element you update, you are asking EA to go and get the whole collection again from the database.
So each Refresh() is going to take just a bit longer than the previous one.

Geert

flofsid

  • EA Novice
  • *
  • Posts: 9
  • Karma: +0/-0
    • View Profile
Re: worse Addin performance with the 64bit version
« Reply #12 on: November 09, 2022, 08:19:32 pm »
I removed the Refresh() calls but that has no effect on the speed  :(

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13288
  • Karma: +557/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: worse Addin performance with the 64bit version
« Reply #13 on: November 09, 2022, 08:35:59 pm »
Weird, would be interesting to figure out which calls exactly are slower than before.

Did you run a performance profile in Visual Studio?

This type of analysis has helped me in the past to identify the bottlenecks and find a solution.

Geert

flofsid

  • EA Novice
  • *
  • Posts: 9
  • Karma: +0/-0
    • View Profile
Re: worse Addin performance with the 64bit version
« Reply #14 on: November 09, 2022, 09:35:51 pm »
I measured a few times again and you're right, it's getting slower and slower over time

half of all elements is generated after 2 minutes but it takes 8 minutes in total

this is not the case with the eap Projects