Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mx_combo_box_append_text() is rather inefficient #64

Open
tthef opened this issue Aug 29, 2012 · 1 comment
Open

mx_combo_box_append_text() is rather inefficient #64

tthef opened this issue Aug 29, 2012 · 1 comment

Comments

@tthef
Copy link

tthef commented Aug 29, 2012

mx_combo_box_append_text(), and all the other related functions, will destroy the existing menu and construct a new one in its place, i.e., to populate a combo with 10 items, nine menus with 1, 2, 3, ... 9 items are constructed and destroyed unnecessarily on the way to the 10 item menu. Consequently the time it takes to populate MxComboBox becomes quickly user-perceptible (on 1.8GHz Atom with i915 graphics card a box with 50 items takes several seconds to construct, reaching 45s for 150 items).

A huge improvement can be had by adding an append function that takes a string vector, allowing to add multiple items; I have a preliminary patch for this, though not sure about the function name. Can make a proper patch if this is of interest.

P.S. I realize that pushing 150 items into a combo box makes for terrible UI, but that's an orthogonal issue :)

@thos
Copy link
Member

thos commented Aug 30, 2012

The new API seems reasonable, but is there any way to make mx_combo_box_append_text() more efficient itself?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants