woboq / verdigris

Qt without moc: set of macros to use Qt without needing moc
https://woboq.com/blog/verdigris-qt-without-moc.html
GNU Lesser General Public License v3.0
638 stars 58 forks source link

PoC: Specialized Tuple instead of binary::tree #57

Closed arBmind closed 5 years ago

arBmind commented 5 years ago

The usage of binary tree seems quite excessive, so I tried to use a simple constexpr enabled tuple implementation as a replacement.

The new tuple is only used for StaticStringList right now and it saves like 5-8% of total compile time. So it seems to work well.

What do you think? Is it worth to complete this?

ogoffart commented 5 years ago

wobjectdefs.h is completely changed. Maybe something wrong with the line ending.

ogoffart commented 5 years ago

I have myself played with a tuple. But I was not so successful at making it work.

I just pushed a tuple branch, see commit 2b4ec3530215b351bb32c9edcc1409aa4f617eee But it wasn't faster for me so i must have done something wrong.

arBmind commented 5 years ago

wobjectdefs.h is completely changed. Maybe something wrong with the line ending.

Oh, sorry. My rebase tool might have skrewed it up. You can use ignore whitespace changes to view the changes for now. I will try to fix that.

arBmind commented 5 years ago

I just pushed a tuple branch, see commit 2b4ec35 But it wasn't faster for me so i must have done something wrong.

Some differences:

arBmind commented 5 years ago

I also implemented the concatenation of an entire string list without any recursion.

But compile times still feel too slow… Maybe we need C++17 to do better on this.

arBmind commented 5 years ago

I fixed the line ending issue.

It seems I broke something. The empty strings are no longer stored correctly.

arBmind commented 5 years ago

Yay, all green now.

@ogoffart Can you check the compile efforts of gcc to compare it before and after? - It should a least be comparable.

arBmind commented 5 years ago

As it turns out, with the forward counters we no longer need any tuple implementation. (See #59)

I keep this PR open to allow a timing comparison - I'm still curious.