Performance issue with Rhea c++ implementation

71 views
Skip to first unread message

Umang Sharma

unread,
Jul 1, 2015, 3:09:11 PM7/1/15
to overcon...@googlegroups.com
I am working on a C++ app where I am supposed to align some objects within a canvas based on several constraints. The number of constraints can go as high as 500-1000.

I am using Cassowary Rhea c++ implementation for solving the constraints. The final solved results are good. But I am struggling with the performance. So for 9 objects, i.e 36 variables and around 350 - 450 constraints, my app takes more than 15-20 seconds to solve. For similar set of constraints Apple's AutoLayout takes just 1 second to do the layout. But my usage of Rhea implementation takes way more than 10-15 seconds.

Has it something do to with the way we assign the priorities and weight to the non required constraints? Currently I am not using any edit and stay constraints. I just add all the constraints with some strengths and weights. And then solve it finally. 

I am using all four possible strengths.(Required, strong, medium and weak). Further I am using symbolic weights in various strength levels as follows:
Strong: 100,  50
Medium: 50, 49, 45, 42
Weak: 25, 30

It would be great if someone can provide me some insight on this. A similar example implementation would be a great help.

Thanks.

Alex Russell

unread,
Jul 13, 2015, 5:07:13 AM7/13/15
to overcon...@googlegroups.com
Any chance you can share your code?

--
You received this message because you are subscribed to the Google Groups "overconstrained" group.
To unsubscribe from this group and stop receiving emails from it, send an email to overconstrain...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ken Ferry

unread,
Jul 13, 2015, 5:42:44 AM7/13/15
to overcon...@googlegroups.com
I'd be interested to see the Auto Layout version too. 

A second is still an _extremely_ long time. I'm currently measuring the main window in Mail.app at 1412 constraints.

-ken
Reply all
Reply to author
Forward
0 new messages