kicad-developers team mailing list archive
-
kicad-developers team
-
Mailing list archive
-
Message #11360
Re: Github plugin.
-
To:
KiCad Developers <kicad-developers@xxxxxxxxxxxxxxxxxxx>
-
From:
Dick Hollenbeck <dick@xxxxxxxxxxx>
-
Date:
Mon, 30 Sep 2013 16:39:22 -0500
-
Cc:
Miguel Angel Ajo Pelayo <miguelangel@xxxxxxx>
-
In-reply-to:
<CAB7XPH=YPeDkGrZZx61W_mNRBACkBXWCwi-_dJtPOP7PzfS3yg@mail.gmail.com>
-
Openpgp:
url=http://pool.sks-keyservers.net
-
User-agent:
Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.0
The GITHUB plugin is sluggish in the module viewer and here is why. The module viewer
code is not making any effort to keep the current PLUGIN in RAM.
This causes numerous unnecessary hits against GITHUB, only to retrieve information that
should already be cached in the PLUGIN. Although an effort is made to cache a list of
footprints, this is not the same as keeping the PLUGIN's cache, by keeping the PLUGIN
alive for as long as the currently selected library is alive.
Basically, it is a mess.
I instrumented two API functions, FootprintEnumerate() and FootprintLoad() with printf()s
which show the "this" pointer and aLibraryPath. At first I thought the problem was
internal to GITHUB plugin, but it was not, and it will be a problem using ANY PLUGIN, not
just GITHUB. Probably the KICAD_PLUGIN is a lot slower than it needs to be.
Here we get the list of footprints from aLibraryPath:
FootprintEnumerate: this:0x220f7b0
aLibraryPath:'https://github.com/CarlPoirier/BNC-Sockets_RevA'
Here we cache the library info:
cacheLib: this:0x220f7b0 m_lib_path:''
aLibraryPath:'https://github.com/CarlPoirier/BNC-Sockets_RevA'
and save the library path:
cacheLib2: this:0x220f7b0 m_lib_path:'https://github.com/CarlPoirier/BNC-Sockets_RevA'
aLibraryPath:'https://github.com/CarlPoirier/BNC-Sockets_RevA'
Here we load the first footprint, even though it is not shown yet.
FootprintLoad: this:0x220f7b0 aLibraryPath:'https://github.com/CarlPoirier/BNC-Sockets_RevA'
Here we load it again, don't know why:
FootprintLoad: this:0x220f7b0 aLibraryPath:'https://github.com/CarlPoirier/BNC-Sockets_RevA'
Re-cache the *entire* library information by hitting https://github.com again!
(Please don't) Notice the "this" pointer has changed, somebody dropped the old
PLUGIN pointer. This is the reason for the sluggishness.
FootprintLoad: this:0x22119e0 aLibraryPath:'https://github.com/CarlPoirier/BNC-Sockets_RevA'
Cache the info
cacheLib: this:0x22119e0 m_lib_path:''
aLibraryPath:'https://github.com/CarlPoirier/BNC-Sockets_RevA'
cacheLib2: this:0x22119e0 m_lib_path:'https://github.com/CarlPoirier/BNC-Sockets_RevA'
aLibraryPath:'https://github.com/CarlPoirier/BNC-Sockets_RevA'
Pick a new footprint in the UI, but too bad the PLUGIN is being reloaded AGAIN!
FootprintLoad: this:0x21e12b0 aLibraryPath:'https://github.com/CarlPoirier/BNC-Sockets_RevA'
cacheLib: this:0x21e12b0 m_lib_path:''
aLibraryPath:'https://github.com/CarlPoirier/BNC-Sockets_RevA'
cacheLib2: this:0x21e12b0 m_lib_path:'https://github.com/CarlPoirier/BNC-Sockets_RevA'
aLibraryPath:'https://github.com/CarlPoirier/BNC-Sockets_RevA'
Continue with the inefficient strategy:
FootprintLoad: this:0x2224f60 aLibraryPath:'https://github.com/CarlPoirier/BNC-Sockets_RevA'
cacheLib: this:0x2224f60 m_lib_path:''
aLibraryPath:'https://github.com/CarlPoirier/BNC-Sockets_RevA'
cacheLib2: this:0x2224f60 m_lib_path:'https://github.com/CarlPoirier/BNC-Sockets_RevA'
aLibraryPath:'https://github.com/CarlPoirier/BNC-Sockets_RevA'
FootprintEnumerate: this:0x22376c0
aLibraryPath:'https://github.com/CarlPoirier/Buzzer_Beeper_RevA_25Oct2010'
cacheLib: this:0x22376c0 m_lib_path:''
aLibraryPath:'https://github.com/CarlPoirier/Buzzer_Beeper_RevA_25Oct2010'
cacheLib2: this:0x22376c0
m_lib_path:'https://github.com/CarlPoirier/Buzzer_Beeper_RevA_25Oct2010'
aLibraryPath:'https://github.com/CarlPoirier/Buzzer_Beeper_RevA_25Oct2010'
FootprintLoad: this:0x22376c0
aLibraryPath:'https://github.com/CarlPoirier/Buzzer_Beeper_RevA_25Oct2010'
FootprintLoad: this:0x22376c0
aLibraryPath:'https://github.com/CarlPoirier/Buzzer_Beeper_RevA_25Oct2010'
FootprintLoad: this:0x22376c0
aLibraryPath:'https://github.com/CarlPoirier/Buzzer_Beeper_RevA_25Oct2010'
FootprintLoad: this:0x22376c0
aLibraryPath:'https://github.com/CarlPoirier/Buzzer_Beeper_RevA_25Oct2010'
FootprintLoad: this:0x22376c0
aLibraryPath:'https://github.com/CarlPoirier/Buzzer_Beeper_RevA_25Oct2010'
FootprintLoad: this:0x22376c0
aLibraryPath:'https://github.com/CarlPoirier/Buzzer_Beeper_RevA_25Oct2010'
FootprintLoad: this:0x2210ac0
aLibraryPath:'https://github.com/CarlPoirier/Buzzer_Beeper_RevA_25Oct2010'
cacheLib: this:0x2210ac0 m_lib_path:''
aLibraryPath:'https://github.com/CarlPoirier/Buzzer_Beeper_RevA_25Oct2010'
cacheLib2: this:0x2210ac0
m_lib_path:'https://github.com/CarlPoirier/Buzzer_Beeper_RevA_25Oct2010'
aLibraryPath:'https://github.com/CarlPoirier/Buzzer_Beeper_RevA_25Oct2010'
FootprintLoad: this:0x22357f0
aLibraryPath:'https://github.com/CarlPoirier/Buzzer_Beeper_RevA_25Oct2010'
cacheLib: this:0x22357f0 m_lib_path:''
aLibraryPath:'https://github.com/CarlPoirier/Buzzer_Beeper_RevA_25Oct2010'
cacheLib2: this:0x22357f0
m_lib_path:'https://github.com/CarlPoirier/Buzzer_Beeper_RevA_25Oct2010'
aLibraryPath:'https://github.com/CarlPoirier/Buzzer_Beeper_RevA_25Oct2010'
Follow ups
References
-
Re: Github plugin.
From: Dick Hollenbeck, 2013-09-22
-
Re: Github plugin.
From: Brian Sidebotham, 2013-09-26
-
Re: Github plugin.
From: Dick Hollenbeck, 2013-09-26
-
Re: Github plugin.
From: Brian Sidebotham, 2013-09-29
-
Re: Github plugin.
From: Dick Hollenbeck, 2013-09-29
-
Re: Github plugin.
From: Brian Sidebotham, 2013-09-30
-
Re: Github plugin.
From: Carl Poirier, 2013-09-30
-
Re: Github plugin.
From: Dick Hollenbeck, 2013-09-30
-
Re: Github plugin.
From: Carl Poirier, 2013-09-30
-
Re: Github plugin.
From: Carl Poirier, 2013-09-30