<div dir="ltr"><div>Hey Dennis,<br><br></div>so I suppose it is my turn to respond. Maybe Eike and/or Kohei will jump in as well.<br><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Oct 9, 2015 at 2:14 AM, Dennis Francis <span dir="ltr"><<a href="mailto:dennisfrancis.in@gmail.com" target="_blank">dennisfrancis.in@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div><div><div>Hi All<br><br></div>I have made an attempt at making the column container relatively dynamic in<br></div>the hope of increasing the column limit to 16K. The patch I have made ( <a href="https://gist.github.com/dennisfrancis/ba7254405f77282214bb#file-lo16kcols-patch" target="_blank">https://gist.github.com/dennisfrancis/ba7254405f77282214bb#file-lo16kcols-patch</a> ) does not have the required "big" refactoring, and have just enough changes to make everything compile and pass<br>the unit tests. I was not sure whether to put this very incomplete version in gerrit.<br><br>The underlying data structure is now a std::vector whose size can dynamically move between <br>1K(min) and 16K(max). This is wrapped in a template class called ScColContainer which could be <br>used in places where fixed size (MAXCOLCOUNT) arrays are used. The underlying data structure <br>can be changed relatively easily inside this template class without breaking the methods/operator <br>signatures.<br><br></div><div>Before I begin further refactoring I would like to discuss the various possibilities of data structures<br></div><div>which you already have in mind, that could be used here instead of just a std::vector, and their merits, demerits etc..<br><br></div><div>In the current approach, the plan is to have the same performance guarantees for sheets upto 1K cols and for sheets greater 1K, allocate only the required number of columns and only iterate over the column range 0 to largest column present actually in the sheet, instead of iterating over a fixed col range (0 to MAXCOL).<br><br></div><div>Please point out any deficiencies, blockades with my current approach and indicate better methods.<br><br></div><div>Thanks for you time.<br><br></div><div>Regards,<br></div><div>Dennis<br></div><br></div></div><br></blockquote><div><br></div><div>This is surely not what we had in mind. Basically you just wrote a wrapper around std::vector.<br><br></div><div>There are a number of items a new design need:<br><br></div><div>* decision whether to store all ScColumn instances or only filled ones<br><br></div><div>* a way to handle the increased memory load<br></div><div>** most likely limiting the number of initial columns<br><br></div><div>* a way to handle the performance impact of many columns<br></div><div>** most likely improving the iterations through all columns<br><br></div><div>* a better way to handle row formattings<br></div><div>** what happens if someone marks a whole row and formats it<br></div><div>** how to handle formatting for columns that were allocated after the user formatted the whole row<br><br></div><div>* most likely a way to store the last formatted column and the last column with content<br></div><div>** needs some inspecting which loops through the columns need which of the information<br><br><br></div><div>Most likely a few more that I have not in mind right now.<br><br></div><div>A simple high level design could be to use a std::vector<ScColumn*> and only allocate columns that really contain content or formatting. Additionally we'd need to introduce a way to store the format of a row. These row formats might not be visible to the user and would be just an internal way to handle the formatting for all not yet allocated columns.<br><br></div><div>Of course there might be other designs that work as well or better but any design needs to deal with at least the problems mentioned above.<br><br></div><div>Regards,<br></div><div>Markus<br></div></div><br></div></div>