Re: C++11 in LibreOffice
On Saturday 21 of July 2012, Kohei Yoshida wrote: On 07/19/2012 11:26 AM, Michael Meeks wrote: On Thu, 2012-07-19 at 16:04 +0200, Michael Stahl wrote: i'm saying it doesn't benefit from the sophisticated optimizations that vendor compilers like SunStudio or Intel do that speed up your BLAS stuff with gigabytes of floating point arrays by X times because office suites don't contain gigabytes of floating point arrays. So - Kohei has been working for years to turn Calc spreadsheets into gigabyte arrays of floating point numbers - precisely to take advantage of this sort of optimisation :-) Just wrote a blog post explaining some of that. http://kohei.us/2012/07/20/mdds-multi_type_vector-explained/ Almost 2 years in the making (well, that also includes one year of just thinking about it idly with no code), I'm glad I've finally got this one off my shoulder. :-) But no doubt more work is ahead to further optimize this structure. Where's the benchmark for that? I'd like to see what difference it makes, but I cannot find anything in the blog post. -- Lubos Lunak l.lu...@suse.cz ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
Re: C++11 in LibreOffice
On Thursday 19 of July 2012, Michael Meeks wrote: Having said that, I totally agree, our problems are 95% algorithmic, and fiddling with compiler optimiser settings is the last refuge of the desperate man ;-) The thing that concerns me about gcc vs. MSVC++ is not the speed of the generated code, but it's size (which impacts startup performance, I/O load, memory use etc.). If you checkout the tables you linked the binary size column is quite stark: http://www.willus.com/ccomp_benchmark2.shtml?p18+s12 http://www.willus.com/ccomp_benchmark2.shtml?p14+s12 in several cases a 2x growth. So - clearly this would need benchmarking various ways to see what the story is there with -Os etc. The other interesting thing in the table is that interprocedural optimization makes quite a difference with MSVC. It would be quite worth trying that one out with LO. -- Lubos Lunak l.lu...@suse.cz ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
Re: C++11 in LibreOffice
Hi Lubos, On Mon, 2012-07-23 at 11:04 +0200, Lubos Lunak wrote: But no doubt more work is ahead to further optimize this structure. Where's the benchmark for that? I'd like to see what difference it makes, but I cannot find anything in the blog post. Benchmark ? as in a huge sheet that performs poorly ? that's pretty easy, banal examples abound - and better data structures are at the root of fixing all of them. So - for example fill column A with 1 and copy-down =A1 from B1 to fill column B. With the planned new data structures we can slowly move this to being as instant and tiny as it deserves to be (based on the ~absence of information in the sheet) ;-) We have some huge scope for really exciting optimisations, memory improvements, efficiency wins more with this new structures, although much of the fun will come from sharing formulae, re-working the dependency logic to be based on blocks of similar formulae and other fun things :-) calc is a really fertile place to hack there, though naturally there is a -lot- of work to do yet before ScCell is dead ;-) [ assuming I managed to persuade everyone that is a good idea ;-]. ATB, Michael. -- michael.me...@suse.com , Pseudo Engineer, itinerant idiot ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
mdds::multi_type_vector (was: Re: C++11 in LibreOffice)
On 07/23/2012 05:04 AM, Lubos Lunak wrote: Where's the benchmark for that? I'd like to see what difference it makes, but I cannot find anything in the blog post. Good question. I didn't put benchmark data in because I wanted to first get the background story out first, which I knew was going to be somewhat long. I'll do another blog post just for benchmarks, and for other performance considerations. Having said that, I have _some_ numbers to share. While I can't really test the real spreadsheet storage benchmark since doing that would require we actually put this structure into ScColumn for real), we can simulate it by using the former matrix backend container mixed_type_matrix, and compare it to multi_type_matrix which uses multi_type_vector as its backend storage. mixed_type_matrix also had its elements allocated on the heap and their memory locations stored in its primary array, so it had the same weakness as the current cell storage model in ScColumn. Here are the numbers. The test scenario is to 1) create a 100,000 by 1,000 matrix instance and fill it with numeric values, and 2) iterate through all its elements and calculate their total. The results are: mixed_type_matrix: 1) 0.887776 sec 2) 1.96097 sec multi_type_matrix: 1) 0.819243 sec 2) 0.364899 sec The instantiation and insertion performance is only slightly faster, but element iteration performance is noticeably faster with multi_type_matrix. The test code was compiled with g++ with only -Os flag. I haven't tested it with any other optimization flags that gcc provides. Best, Kohei -- Kohei Yoshida, LibreOffice hacker, Calc ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
Re: C++11 in LibreOffice
Hi there, On Thu, 2012-07-19 at 11:21 -0500, Yi Ding wrote: +1 ... +1 ... +1 ... Thanks for your encouragement, but this is a developers list :-) which of these do you want to work on ? There is low-hanging fruit everywhere for developers to focus on - which would you like to look into ? Startup performance for example: reducing the configmgr thrash by tweaking that code to allow us to split out settings that are not commonly needed eg. the labels data would give a measureable boost to startup. It requires only a hacker - is it you ? :-) All the best, Michael. -- michael.me...@suse.com , Pseudo Engineer, itinerant idiot ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
Re: C++11 in LibreOffice
Fair point. :-) Let me see if I can get a build working on Windows this weekend. I see on the wiki that building with VS 2010 is not yet supported: http://wiki.documentfoundation.org/Development/Windows_Build_Dependencies Is this information still current? On Fri, Jul 20, 2012 at 3:43 AM, Michael Meeks michael.me...@suse.com wrote: Hi there, On Thu, 2012-07-19 at 11:21 -0500, Yi Ding wrote: +1 ... +1 ... +1 ... Thanks for your encouragement, but this is a developers list :-) which of these do you want to work on ? There is low-hanging fruit everywhere for developers to focus on - which would you like to look into ? Startup performance for example: reducing the configmgr thrash by tweaking that code to allow us to split out settings that are not commonly needed eg. the labels data would give a measureable boost to startup. It requires only a hacker - is it you ? :-) All the best, Michael. -- michael.me...@suse.com , Pseudo Engineer, itinerant idiot ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
Re: C++11 in LibreOffice
On 20/07/12 16:31, Yi Ding wrote: Fair point. :-) Let me see if I can get a build working on Windows this weekend. I see on the wiki that building with VS 2010 is not yet supported: http://wiki.documentfoundation.org/Development/Windows_Build_Dependencies Is this information still current? yes it is; there is actually a patch for MSVC2010 attached here: https://bugs.freedesktop.org/show_bug.cgi?id=30655 but it is quite outdated and apparently even when it was written there was some CLR thing that didn't work. if you know the MSVC toolchain well then you could try to get that to work, and it would be very useful, but you will probably have to spend some time on it; currently only MSVC 2008 is known to work. ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
Re: C++11 in LibreOffice
On Fri, Jul 20, 2012 at 9:37 AM, Michael Stahl mst...@redhat.com wrote: On 20/07/12 16:31, Yi Ding wrote: Fair point. :-) Let me see if I can get a build working on Windows this weekend. I see on the wiki that building with VS 2010 is not yet supported: http://wiki.documentfoundation.org/Development/Windows_Build_Dependencies Is this information still current? yes it is; there is actually a patch for MSVC2010 attached here: https://bugs.freedesktop.org/show_bug.cgi?id=30655 but it is quite outdated and apparently even when it was written there was some CLR thing that didn't work. if you know the MSVC toolchain well then you could try to get that to work, and it would be very useful, but you will probably have to spend some time on it; currently only MSVC 2008 is known to work. Great, thanks. I'll give it a try, although after reading the Building on Windows thread I might end up giving up and just running the build on a VM. ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
Re: C++11 in LibreOffice
On 07/19/2012 11:26 AM, Michael Meeks wrote: On Thu, 2012-07-19 at 16:04 +0200, Michael Stahl wrote: i'm saying it doesn't benefit from the sophisticated optimizations that vendor compilers like SunStudio or Intel do that speed up your BLAS stuff with gigabytes of floating point arrays by X times because office suites don't contain gigabytes of floating point arrays. So - Kohei has been working for years to turn Calc spreadsheets into gigabyte arrays of floating point numbers - precisely to take advantage of this sort of optimisation :-) Just wrote a blog post explaining some of that. http://kohei.us/2012/07/20/mdds-multi_type_vector-explained/ Almost 2 years in the making (well, that also includes one year of just thinking about it idly with no code), I'm glad I've finally got this one off my shoulder. :-) But no doubt more work is ahead to further optimize this structure. Also, ScMatrix's new backend now uses it. My hope is to use ScMatrix as a test-drive and try to get all its kinks sorted out before using this to store cells in ScColumn. Best, Kohei -- Kohei Yoshida, LibreOffice hacker, Calc ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
Re: C++11 in LibreOffice
On 17/07/12 21:21, Kohei Yoshida wrote: On 07/17/2012 05:11 AM, Lubos Lunak wrote: So, as long as we require to build LO with MSVC, we can revisit the question of hard-depending on C++11 in, uhm, let's be optimistic and say 3 years. IOW, we can probably get there faster by ditching backwards ABI compatibility with LO4 and switching to a different compiler for Windows. What I'm curious is how the binaries generated from different compilers compare on Windows. If their performances are more or less comparable, then I could care less whether we stick with MSVC or gcc (or clang if it's available on Windows). But if MSVC still produces more optimized binaries, then I would be reluctant to support switching to a different compiler (though my voice is only one head count, easily overruled by the majority votes when it comes down to it). i don't believe an office suite will benefit all that much from sophisticated compiler optimizations; most of the problems we have are due to stupid algorithms/data structures that don't scale. the _real_ question is, how can you debug problems that happen only on Windows, what does MinGW offer there, does it actually work or does gdb crash all the time like it did 5 years ago on Linux. also, how do you run unit tests when cross compiling? but if you really care here's some recent windows benchmarks that look reasonably well done at first glance, and GCC looks very competitive with MSVC, though Intel is faster still: http://www.willus.com/ccomp_benchmark2.shtml ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
Re: C++11 in LibreOffice
On Thu, Jul 19, 2012 at 7:45 AM, Michael Stahl mst...@redhat.com wrote: i don't believe an office suite will benefit all that much from sophisticated compiler optimizations; It's certainly your opinion. But I tend think that, any binary generated from a compiler could use the benefit of compiler optimization. I find it hard to believe that somehow an office suite category is an exception. But maybe it's just me. Kohei ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
Re: C++11 in LibreOffice
On Thu, Jul 19, 2012 at 08:59:34AM -0400, Kohei Yoshida wrote: On Thu, Jul 19, 2012 at 7:45 AM, Michael Stahl mst...@redhat.com wrote: i don't believe an office suite will benefit all that much from sophisticated compiler optimizations; It's certainly your opinion. But I tend think that, any binary generated from a compiler could use the benefit of compiler optimization. I find it hard to believe that somehow an office suite category is an exception. But maybe it's just me. I think Michael was suggesting that our prouct is IO-bound and not that CPU-bound anyway. While that isnt completely the case for the area you work on it is a valid assumption for the product as a whole. Best, Bjoern ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
Re: C++11 in LibreOffice
On Thu, 2012-07-19 at 16:04 +0200, Michael Stahl wrote: i'm saying it doesn't benefit from the sophisticated optimizations that vendor compilers like SunStudio or Intel do that speed up your BLAS stuff with gigabytes of floating point arrays by X times because office suites don't contain gigabytes of floating point arrays. So - Kohei has been working for years to turn Calc spreadsheets into gigabyte arrays of floating point numbers - precisely to take advantage of this sort of optimisation :-) Having said that, I totally agree, our problems are 95% algorithmic, and fiddling with compiler optimiser settings is the last refuge of the desperate man ;-) The thing that concerns me about gcc vs. MSVC++ is not the speed of the generated code, but it's size (which impacts startup performance, I/O load, memory use etc.). If you checkout the tables you linked the binary size column is quite stark: http://www.willus.com/ccomp_benchmark2.shtml?p18+s12 http://www.willus.com/ccomp_benchmark2.shtml?p14+s12 in several cases a 2x growth. So - clearly this would need benchmarking various ways to see what the story is there with -Os etc. IMHO it's well worth looking at a gcc cross-compiled solution for Windows though; if only to use really fast, fully repeatable, Free Software tooling; though it'd be nice to use an enterprise / maintained cross-compiler - where is cygnus when you need them :-) All the best, Michael. -- michael.me...@suse.com , Pseudo Engineer, itinerant idiot ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
Re: C++11 in LibreOffice
+1 on considering startup performance/memory usage. It looks like with Office 13 Microsoft has done more work in getting Office to startup faster (no benchmarks, just anecdotal experience). +1 on the ability to do some kind of cross-compiling solution in parallel. +1 on gigabyte spreadsheets of floating point numbers. The competition kind of sucks in this regard... :-) On Thu, Jul 19, 2012 at 10:26 AM, Michael Meeks michael.me...@suse.com wrote: On Thu, 2012-07-19 at 16:04 +0200, Michael Stahl wrote: i'm saying it doesn't benefit from the sophisticated optimizations that vendor compilers like SunStudio or Intel do that speed up your BLAS stuff with gigabytes of floating point arrays by X times because office suites don't contain gigabytes of floating point arrays. So - Kohei has been working for years to turn Calc spreadsheets into gigabyte arrays of floating point numbers - precisely to take advantage of this sort of optimisation :-) Having said that, I totally agree, our problems are 95% algorithmic, and fiddling with compiler optimiser settings is the last refuge of the desperate man ;-) The thing that concerns me about gcc vs. MSVC++ is not the speed of the generated code, but it's size (which impacts startup performance, I/O load, memory use etc.). If you checkout the tables you linked the binary size column is quite stark: http://www.willus.com/ccomp_benchmark2.shtml?p18+s12 http://www.willus.com/ccomp_benchmark2.shtml?p14+s12 in several cases a 2x growth. So - clearly this would need benchmarking various ways to see what the story is there with -Os etc. IMHO it's well worth looking at a gcc cross-compiled solution for Windows though; if only to use really fast, fully repeatable, Free Software tooling; though it'd be nice to use an enterprise / maintained cross-compiler - where is cygnus when you need them :-) All the best, Michael. -- michael.me...@suse.com , Pseudo Engineer, itinerant idiot ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
Re: C++11 in LibreOffice
Thank you again. Unfortunately gcc starts to support C++11 only in 4.3, and MSVC has very little C++11 in 2008 (2010 has much more). Uray M. János On Mon, Jul 16, 2012 at 6:53 PM, Kohei Yoshida kohei.yosh...@gmail.comwrote: On Mon, Jul 16, 2012 at 12:35 PM, János Uray uray.ja...@gmail.com wrote: Thank you. It's not a happy answer though. I hoped that there are at least some little features in the intersection of the C++11-knowledge of the supported compilers. The most problematic ones are the gcc compiler used on Mac OS X (gcc 4.0?), and MSVC 2008 compilers. If you (or someone else equally interested) are willing to research those two compilers to see what subset of C++11 features they support (if at all), then I don't see why we shouldn't use those features. For the record, I'm also eager to start using C++11 too, but since the standard being so new that, we need to be realistic and allow some time for all our major platforms to support it. Kohei ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
Re: C++11 in LibreOffice
On 07/16/2012 06:53 PM, Kohei Yoshida wrote: The most problematic ones are the gcc compiler used on Mac OS X (gcc 4.0?), and MSVC 2008 compilers. If you (or someone else equally interested) are willing to research those two compilers to see what subset of C++11 features they support (if at all), then I don't see why we shouldn't use those features. http://wiki.apache.org/stdcxx/C++0xCompilerSupport is a useful source. Stephan ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
Re: C++11 in LibreOffice
On Tuesday 17 of July 2012, Stephan Bergmann wrote: On 07/16/2012 06:53 PM, Kohei Yoshida wrote: The most problematic ones are the gcc compiler used on Mac OS X (gcc 4.0?), and MSVC 2008 compilers. If you (or someone else equally interested) are willing to research those two compilers to see what subset of C++11 features they support (if at all), then I don't see why we shouldn't use those features. http://wiki.apache.org/stdcxx/C++0xCompilerSupport is a useful source. Also http://blogs.msdn.com/b/vcblog/archive/2011/09/12/10209291.aspx . Summary: The first version to have something interesting (lambda expressions, rvalue references, static_assert) is MSVC2010. Range-based for loop is MSVC2012, which has only RC out by now, and requires Window7+. Some stuff, such as variadic templates or delegating ctors, are not there at all. So, as long as we require to build LO with MSVC, we can revisit the question of hard-depending on C++11 in, uhm, let's be optimistic and say 3 years. IOW, we can probably get there faster by ditching backwards ABI compatibility with LO4 and switching to a different compiler for Windows. -- Lubos Lunak l.lu...@suse.cz ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
Re: C++11 in LibreOffice
On 07/17/2012 05:11 AM, Lubos Lunak wrote: So, as long as we require to build LO with MSVC, we can revisit the question of hard-depending on C++11 in, uhm, let's be optimistic and say 3 years. IOW, we can probably get there faster by ditching backwards ABI compatibility with LO4 and switching to a different compiler for Windows. What I'm curious is how the binaries generated from different compilers compare on Windows. If their performances are more or less comparable, then I could care less whether we stick with MSVC or gcc (or clang if it's available on Windows). But if MSVC still produces more optimized binaries, then I would be reluctant to support switching to a different compiler (though my voice is only one head count, easily overruled by the majority votes when it comes down to it). Kohei -- Kohei Yoshida, LibreOffice hacker, Calc ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
Re: C++11 in LibreOffice
2012/7/17 Kohei Yoshida kohei.yosh...@gmail.com: On 07/17/2012 05:11 AM, Lubos Lunak wrote: So, as long as we require to build LO with MSVC, we can revisit the question of hard-depending on C++11 in, uhm, let's be optimistic and say 3 years. IOW, we can probably get there faster by ditching backwards ABI compatibility with LO4 and switching to a different compiler for Windows. What I'm curious is how the binaries generated from different compilers compare on Windows. If their performances are more or less comparable, then I could care less whether we stick with MSVC or gcc (or clang if it's available on Windows). But if MSVC still produces more optimized binaries, then I would be reluctant to support switching to a different compiler (though my voice is only one head count, easily overruled by the majority votes when it comes down to it). Kohei Clang is not directly available as a binary for windows, however they have a small tutorial how to build it from source at http://clang.llvm.org/get_started.html#buildWindows. ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
C++11 in LibreOffice
I have a simple question. Can I use C++11 in LibreOffice development? Or at least some parts of C++11? Thanks Uray M. János ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
Re: C++11 in LibreOffice
Forgot to reply all in this gmail web interface... On Mon, Jul 16, 2012 at 12:22 PM, Kohei Yoshida kohei.yosh...@gmail.com wrote: On Mon, Jul 16, 2012 at 12:15 PM, János Uray uray.ja...@gmail.com wrote: I have a simple question. Can I use C++11 in LibreOffice development? Or at least some parts of C++11? The short answer is, no, not yet. We still need to support compilers that don't support C++11 fully. I think that, eventually we'll be able to start using C++11 features in our code base, but it'll take a while before we get to that point. I hope this answers your question. Kohei ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
Re: C++11 in LibreOffice
On Mon, Jul 16, 2012 at 12:35 PM, János Uray uray.ja...@gmail.com wrote: Thank you. It's not a happy answer though. I hoped that there are at least some little features in the intersection of the C++11-knowledge of the supported compilers. The most problematic ones are the gcc compiler used on Mac OS X (gcc 4.0?), and MSVC 2008 compilers. If you (or someone else equally interested) are willing to research those two compilers to see what subset of C++11 features they support (if at all), then I don't see why we shouldn't use those features. For the record, I'm also eager to start using C++11 too, but since the standard being so new that, we need to be realistic and allow some time for all our major platforms to support it. Kohei ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
Re: C++11 in LibreOffice
On Mon, Jul 16, 2012 at 12:53:24PM -0400, Kohei Yoshida wrote: On Mon, Jul 16, 2012 at 12:35 PM, János Uray uray.ja...@gmail.com wrote: Thank you. It's not a happy answer though. I hoped that there are at least some little features in the intersection of the C++11-knowledge of the supported compilers. The most problematic ones are the gcc compiler used on Mac OS X (gcc 4.0?), and MSVC 2008 compilers. gcc started implementing C++11 with 4.3, MSVC started relevant partial support with 10.0/11.0. If you (or someone else equally interested) are willing to research those two compilers to see what subset of C++11 features they support (if at all), then I don't see why we shouldn't use those features. Not even a subset, I fear. Also note the gcc C++11 ABI is not guaranteed to be C++03 compatible discussion in the ESC minutes: there are more traps lurking here. Best, Bjoern ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice