element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet & Tria Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • About Us
    About the element14 Community
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Japan
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      •  Vietnam
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Autodesk EAGLE
  • Products
  • More
Autodesk EAGLE
EAGLE User Support (English) very long ulp execution time for simple stuff
  • Blog
  • Forum
  • Documents
  • Events
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Autodesk EAGLE to participate - click to join for free!
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • Replies 7 replies
  • Subscribers 187 subscribers
  • Views 682 views
  • Users 0 members are here
Related

very long ulp execution time for simple stuff

autodeskguest
autodeskguest over 10 years ago

To find all the nest belonging to a right clicked symbol (7.5.0 and

7.5.4 beta tested), I run this ULP on a context menu of

the instance object, debug info included:

 

-


string tmpstr;

UL_INSTANCE foundinst;

schematic(SCH) SCH.sheets(S) S.instances(I) if(ingroup(I)) foundinst=I;

int i=0;

int t=time();

sprintf(tmpstr,"%s(%s):Start\n",tmpstr,t2string(t,"h:mm:ss:zzz"));

schematic(SCH) SCH.nets(N) N.pinrefs(PR)

{

i++;

if(PR.part.name==foundinst.part.name &&

PR.instance.name==foundinst.name) sprintf(tmpstr,"%s(%s,%d):Found

%s\n",tmpstr,t2string(time(),"h:mm:ss"),i,N.name);

}

t=time();

sprintf(tmpstr,"%s(%s,%d):End\n",tmpstr,t2string(t,"h:mm:ss"),i);

dlgMessageBox(tmpstr);

-


(sorry for the NNTP line breaks)

 

Now I have a large design, but not large enough to defend 2min execution

time for ~7 contactrefs? Whats going on here?

Here is my messagebox output for a random symbol:

 

(17:31:11:000):Start

(17:32:58,6245):Found GND

(17:32:58,6246):Found GND

(17:32:58,6247):Found GND

(17:33:00,6446):Found LCD_VDDIO

(17:33:00,6448):Found LCD_VDDLCD

(17:33:04,6622):Found N$20

(17:33:04,6624):Found N$22

(17:33:09,6849):Found TFT_DB0

(17:33:09,6851):Found TFT_DB1

(17:33:10,6853):Found TFT_DB2

(17:33:10,6855):Found TFT_DB3

(17:33:10,6857):Found TFT_DB4

(17:33:10,6859):Found TFT_DB5

(17:33:10,6861):Found TFT_DB6

(17:33:10,6863):Found TFT_DB7

(17:33:10,6865):Found TFT_DNC

(17:33:10,6867):Found TFT_NCS

(17:33:10,6869):Found TFT_NRD

(17:33:10,6871):Found TFT_NRST

(17:33:11,6873):Found TFT_WR

(17:33:21,7386):End

 

  • Sign in to reply
  • Cancel
  • autodeskguest
    autodeskguest over 10 years ago

    On 10.05.2016 14:57, Richard Hammerl wrote:

     

    But maybe for your purpose it is enough to use the following ULP?

    It runs on sheet level; of course bogus connection to pwr pins

    are missed (as it is with your schematic on sheet 17, IC1100,

    Net: MGTAVCC_L).

     

    --------------------------

    string tmpstr;

     

     

    int i=0;

    int t=time();

    sprintf(tmpstr,"%s(%s):Start\n",tmpstr,t2string(t,"h:mm:ss:zzz"));

     

    sheet(S) S.instances(I) if(ingroup(I)) {

      S.nets(N) N.segments(SEG) SEG.pinrefs(PR) {

        i++;

        if (PR.part.name==I.part.name && PR.instance.name==I.name)

           sprintf(tmpstr,"%s(%s,%d):Found

    %s\n",tmpstr,t2string(time(),"h:mm:ss"),i,N.name);

      }

    }

     

    t=time();

    sprintf(tmpstr,"%s(%s,%d):End\n",tmpstr,t2string(t,"h:mm:ss"),i);

    dlgMessageBox(tmpstr);

     

    --------------------------

     

    Thank you Richard! This was the speedy way that solved the problem image

     

     

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • autodeskguest
    autodeskguest over 10 years ago

    Am 10.05.2016 um 11:02 schrieb Morten Leikvoll:

    On 10.05.2016 10:13, Richard Hammerl wrote:

    we can reproduce this effect, but do not see this huge time difference.

    A schematic with about 3700 pin refs is about three times slower in V7

    compared to V6. Could you please send me an example schematic where

    you have this long execution time of the ULP?

     

    I have sent you my files. Let me know if they don't show up.

     

     

    Okay, now I know a bit more....

    What strikes me first when running the ULP in V6 and V7 besides

    different time is the different number of found pinrefs.

    In V6 we have 7384, since 7.3 we have 7395; 11 more.

     

    In some situations it could happen that the output of pinfefs of

    nets in the schematic did not take into consideration unconnected/

    implicit power pins. To achieve this the effort for the pinrefs loop

    is significantly higher.

     

    But maybe for your purpose it is enough to use the following ULP?

    It runs on sheet level; of course bogus connection to pwr pins

    are missed (as it is with your schematic on sheet 17, IC1100,

    Net: MGTAVCC_L).

     

     

    -


    string tmpstr;

     

     

    int i=0;

    int t=time();

    sprintf(tmpstr,"%s(%s):Start\n",tmpstr,t2string(t,"h:mm:ss:zzz"));

     

    sheet(S) S.instances(I) if(ingroup(I)) {

       S.nets(N) N.segments(SEG) SEG.pinrefs(PR) {

         i++;

         if (PR.part.name==I.part.name && PR.instance.name==I.name)

            sprintf(tmpstr,"%s(%s,%d):Found

    %s\n",tmpstr,t2string(time(),"h:mm:ss"),i,N.name);

       }

    }

     

    t=time();

    sprintf(tmpstr,"%s(%s,%d):End\n",tmpstr,t2string(t,"h:mm:ss"),i);

    dlgMessageBox(tmpstr);

     

    -


     

     

    Nevertheless we will try to speed up this pinrefs loop.

     

     

    --

    Mit freundlichen Gruessen / Best regards

    Richard Hammerl

      CadSoft Support -- hotline@cadsoft.de

      FAQ: http://www.cadsoft.de/training/faq/

     

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • autodeskguest
    autodeskguest over 10 years ago

    On 10.05.2016 10:13, Richard Hammerl wrote:

    we can reproduce this effect, but do not see this huge time difference.

    A schematic with about 3700 pin refs is about three times slower in V7

    compared to V6. Could you please send me an example schematic where

    you have this long execution time of the ULP?

     

    I have sent you my files. Let me know if they don't show up.

     

     

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • autodeskguest
    autodeskguest over 10 years ago

    Am 09.05.2016 um 11:03 schrieb Morten Leikvoll:

    On 06.05.2016 17:33, Morten Leikvoll wrote:

     

    I just tested this on old 6.5.4, and it is ALOT faster there.

    An almost empty loop like:

     

    schematic(SCH) SCH.nets(N) N.pinrefs(PR) i++;

     

    ..takes 3 seconds vs on Eagle 6.5.4 vs 138(!!!) seconds on Eagle 7.5.4.

     

    Same design. I use no modules.

    Imo it should take <<3sec too.

     

     

    Hi Morten,

     

    we can reproduce this effect, but do not see this huge time difference.

    A schematic with about 3700 pin refs is about three times slower in V7

    compared to V6. Could you please send me an example schematic where

    you have this long execution time of the ULP?

     

     

    --

    Mit freundlichen Gruessen / Best regards

    Richard Hammerl

      CadSoft Support -- hotline@cadsoft.de

      FAQ: http://www.cadsoft.de/training/faq/

     

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • autodeskguest
    autodeskguest over 10 years ago

    On 06.05.2016 17:33, Morten Leikvoll wrote:

     

    I just tested this on old 6.5.4, and it is ALOT faster there.

    An almost empty loop like:

     

    schematic(SCH) SCH.nets(N) N.pinrefs(PR) i++;

     

    ..takes 3 seconds vs on Eagle 6.5.4 vs 138(!!!) seconds on Eagle 7.5.4.

     

    Same design. I use no modules.

    Imo it should take <<3sec too.

     

     

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • autodeskguest
    autodeskguest over 10 years ago

    On 07.05.2016 07:17, warrenbrayshaw wrote:

    The maximum time will occur if your target instance is the last instance

    on the last sheet.

    So to improve the average time it takes to run the ulp, break out as

    soon as you find your instance.

     

    Then you look at the nets and their pinrefs. The nets of interest could

    have been the last created and so it will take a long time to get to them.

     

    In your example you reviewed 6244 pinrefs before you find your first

    pinref so that where most of the time was used.

     

    Once you found the first one it took 13 seconds over 628 pinrefs.

    Hmmm... that,s not quick.

     

    I tried the example Arduino Schematic and got 84 pin refs in a second so

    I would expect 8 seconds max for 628 (my PC Win7 i7 3.4 Ghz)

     

    In the past I have detected slow performance and had to not use sprintf

    to concatenate strings.

     

    Another thought, try placing foundinst.part.name and foundinst.name into

    a string variable once. Fetching them repeatedly that way may give a

    speed advantage over digging into the foundinst object.

     

     

    The problem is more fundamental. Even doing the pinrefs loop without any

    if condition will take 20+ seconds. It looks like Eagle is preparing a

    lot of data for each time you access the pinref loop.

     

     

     

     

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • autodeskguest
    autodeskguest over 10 years ago

    On 7/05/2016 3:33 a.m., Morten Leikvoll wrote:

    To find all the nest belonging to a right clicked symbol (7.5.0 and

    7.5.4 beta tested), I run this ULP on a context menu of

    the instance object, debug info included:

     

    ---------------

    string tmpstr;

    UL_INSTANCE foundinst;

    schematic(SCH) SCH.sheets(S) S.instances(I) if(ingroup(I)) foundinst=I;

    int i=0;

    int t=time();

    sprintf(tmpstr,"%s(%s):Start\n",tmpstr,t2string(t,"h:mm:ss:zzz"));

    schematic(SCH) SCH.nets(N) N.pinrefs(PR)

    {

    i++;

    if(PR.part.name==foundinst.part.name &&

    PR.instance.name==foundinst.name) sprintf(tmpstr,"%s(%s,%d):Found

    %s\n",tmpstr,t2string(time(),"h:mm:ss"),i,N.name);

    }

    t=time();

    sprintf(tmpstr,"%s(%s,%d):End\n",tmpstr,t2string(t,"h:mm:ss"),i);

    dlgMessageBox(tmpstr);

    ----------

    (sorry for the NNTP line breaks)

     

    Now I have a large design, but not large enough to defend 2min execution

    time for ~7 contactrefs? Whats going on here?

    Here is my messagebox output for a random symbol:

     

    (17:31:11:000):Start

    (17:32:58,6245):Found GND

    (17:32:58,6246):Found GND

    (17:32:58,6247):Found GND

    (17:33:00,6446):Found LCD_VDDIO

    (17:33:00,6448):Found LCD_VDDLCD

    (17:33:04,6622):Found N$20

    (17:33:04,6624):Found N$22

    (17:33:09,6849):Found TFT_DB0

    (17:33:09,6851):Found TFT_DB1

    (17:33:10,6853):Found TFT_DB2

    (17:33:10,6855):Found TFT_DB3

    (17:33:10,6857):Found TFT_DB4

    (17:33:10,6859):Found TFT_DB5

    (17:33:10,6861):Found TFT_DB6

    (17:33:10,6863):Found TFT_DB7

    (17:33:10,6865):Found TFT_DNC

    (17:33:10,6867):Found TFT_NCS

    (17:33:10,6869):Found TFT_NRD

    (17:33:10,6871):Found TFT_NRST

    (17:33:11,6873):Found TFT_WR

    (17:33:21,7386):End

     

     

    Hi Morten

     

    The maximum time will occur if your target instance is the last instance

    on the last sheet.

    So to improve the average time it takes to run the ulp, break out as

    soon as you find your instance.

     

    Then you look at the nets and their pinrefs. The nets of interest could

    have been the last created and so it will take a long time to get to them.

     

    In your example you reviewed 6244 pinrefs before you find your first

    pinref so that where most of the time was used.

     

    Once you found the first one it took 13 seconds over 628 pinrefs.

    Hmmm... that,s not quick.

     

    I tried the example Arduino Schematic and got 84 pin refs in a second so

    I would expect 8 seconds max for 628 (my PC Win7 i7 3.4 Ghz)

     

    In the past I have detected slow performance and had to not use sprintf

    to concatenate strings.

     

    Another thought, try placing foundinst.part.name and foundinst.name into

    a string variable once. Fetching them repeatedly that way may give a

    speed advantage over digging into the foundinst object.

     

    HTH

    Warren

     

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2026 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube