Some comments:
The duplication seems to be resolved now. But....
In the last modifications to the runtime library, John Lenz added a
binary search for types,
but the cast info still seems to be a plain list. In mos of the cases,
that should be fine, but
in large type systems, probably that will create some performance
issues. The think is
I am not sure how "large" the type systems has to be for you to see the
problem, even
more now that we hardly call SWIG_TypeQuery (at least in python)....
anyway, this is
a research topic for an interested CS student.
Marcelo
Robin Dunn wrote:
> It does work with the new version of swiginit.swg, however it now can
> end up with duplicate cast converters in the list. Is it worth the
> extra startup-time to not add casts if there is already a matching one
> in the list?
>
> FYI, to easily see and test this I added wrappers for swig_type_info
> and swig_cast_info and used the attached test script, and got this
> output:
>
>
> -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
> Test: wxEvtHandler*, after importing _core
> -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
> 9 items
> ['_p_wxControl',
> '_p_wxControlWithItems',
> '_p_wxEvtHandler',
> '_p_wxMenu',
> '_p_wxMenuBar',
> '_p_wxPyApp',
> '_p_wxPyValidator',
> '_p_wxValidator',
> '_p_wxWindow']
>
> -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
> Test: wxEvtHandler*, after importing _windows
> -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
> 59 items
> ['_p_wxColourDialog',
> '_p_wxControl',
> '_p_wxControl',
> '_p_wxControlWithItems',
> '_p_wxControlWithItems',
> '_p_wxDialog',
> '_p_wxDirDialog',
> '_p_wxEvtHandler',
> '_p_wxEvtHandler',
> '_p_wxFileDialog',
> '_p_wxFindReplaceDialog',
> '_p_wxFontDialog',
> '_p_wxFrame',
> '_p_wxMDIChildFrame',
> '_p_wxMDIClientWindow',
> '_p_wxMDIParentFrame',
> '_p_wxMenu',
> '_p_wxMenu',
> '_p_wxMenuBar',
> '_p_wxMenuBar',
> '_p_wxMessageDialog',
> '_p_wxMiniFrame',
> '_p_wxMultiChoiceDialog',
> '_p_wxPanel',
> '_p_wxPasswordEntryDialog',
> '_p_wxPopupWindow',
> '_p_wxPreviewCanvas',
> '_p_wxPreviewControlBar',
> '_p_wxPreviewFrame',
> '_p_wxProgressDialog',
> '_p_wxPyApp',
> '_p_wxPyApp',
> '_p_wxPyHtmlListBox',
> '_p_wxPyPanel',
> '_p_wxPyPopupTransientWindow',
> '_p_wxPyPreviewControlBar',
> '_p_wxPyPreviewFrame',
> '_p_wxPyScrolledWindow',
> '_p_wxPyTaskBarIcon',
> '_p_wxPyVListBox',
> '_p_wxPyVScrolledWindow',
> '_p_wxPyValidator',
> '_p_wxPyValidator',
> '_p_wxPyWindow',
> '_p_wxSashLayoutWindow',
> '_p_wxSashWindow',
> '_p_wxScrolledWindow',
> '_p_wxSingleChoiceDialog',
> '_p_wxSplashScreen',
> '_p_wxSplashScreenWindow',
> '_p_wxSplitterWindow',
> '_p_wxStatusBar',
> '_p_wxTextEntryDialog',
> '_p_wxTipWindow',
> '_p_wxTopLevelWindow',
> '_p_wxValidator',
> '_p_wxValidator',
> '_p_wxWindow',
> '_p_wxWindow']
>
>
> Robin
>
>
>
> Marcelo Matus wrote:
>
>> Ok, try it now again.
>>
>> Marcelo
>>
>>
>> Robin Dunn wrote:
>>
>>> Robin Dunn wrote:
>>>
>>>> Marcelo Matus wrote:
>>>>
>>>>> Please try the CVS version, there are some critical fixes for the
>>>>> runtime library + the import
>>>>> mechanism. If that doesn't fix the problem, we will need you to
>>>>> try to reproduce the problem
>>>>> with a small example we can play with here.
>>>>
>>>>
>>>>
>>>> Something like the attached should show it.
>>>
>>>
>>>
>>> I forgot to mention that the CVS version does still have the problem.
>>>
>
>
>------------------------------------------------------------------------
>
>
>from pprint import pprint as pp
>
>def testit(msg, klass="wxEvtHandler*"):
> info = _core.SWIG_TypeQuery(klass)
> cast = info.cast
> lst = []
> while cast:
> lst.append(cast.type.name)
> cast = cast.next
>
> lst.sort()
> print
> print '-='*30
> print 'Test: %s, %s' % (klass, msg)
> print '-='*30
> print len(lst), "items"
> pp(lst)
>
>
>import _core
>testit('after importing _core')
>
>import _windows
>testit('after importing _windows')
>
>
>
|