Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • gtk gtk
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 1,603
    • Issues 1,603
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 220
    • Merge requests 220
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Container Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • GNOMEGNOME
  • gtkgtk
  • Issues
  • #2693
Closed
Open
Issue created May 03, 2020 by BenjaminRi@BenjaminRi

Performance problems with gtk_tree_store_set()

Problem description:

Iterating through an entire TreeStore and setting all its elements to an new value shows unexpected performance problems that seem to grow quadratically with the number of elements in the TreeStore.

For example, setting 15000 elements containing UINT64 values takes gtk about 350 milliseconds on my machine.

I plotted the situation:

  • x-axis: Number of elements
  • y-axis (blue): Number of milliseconds to set them all
  • y-axis (red): quadratic curve with constant factor fitted to blue line

plot

Expected behaviour:

For 15000 UINT64 elements, I would expect no more than 3ms processing time on a desktop CPU, and that would already be a lot. Judging from the API, I would expect that setting n elements would be O(n), so, setting the value of one element would be O(1).

Problem reproduction:

https://github.com/BenjaminRi/gtk_treemodel_perf_c

Build with ./compile.sh, start with ./treemodel_perf

The program prints out the number of elements, a comma, and then the number of milliseconds it took to set all the elements.

Version information:

gtk3-3.24.8-1

Seems to happen with any gtk3 version that has been tried so far. Seems to happen on Windows, Linux and possibly other OSes.

Notes:

Discovered via gtk-rs, the Rust gtk wrapper. Behaviour is the same in C and Rust. https://github.com/gtk-rs/gtk/issues/1000

Please let me know if I overlooked performance documentation or if this is expected behaviour. I'm not very experienced with gtk and I couldn't find anything about this issue.

Edited May 03, 2020 by BenjaminRi
Assignee
Assign to
Time tracking