Beta version is slower than version 4.20

Sep 10, 2009 at 11:48 AM
Edited Sep 10, 2009 at 1:27 PM

Lots of problem are fixed in beta version , thanks for all team's member .

Recently , i tried to migrate to the beta version but it look slower than the stable version , the grid take a long time if you are displaying a huge number of line like 20 000 rows  .

You can test this case by opening the samples n° 43 in both version and you will see the difference between them .

 

Coordinator
Sep 10, 2009 at 1:26 PM

What is the difference between stable and beta versions in seconds?

Sep 10, 2009 at 1:36 PM

7 seconds for the version beta to load the sample 43, it is slow however the stable version is very quiqly (less than 1 second )

Coordinator
Sep 15, 2009 at 6:22 AM

The problem is with the column/spanning implementation. The requirement is to disallow cell overlapping. However the current implementation is both buggy(!!) and it is also somewhat slow.

I am trying to find other grid projects in any language (c++, java, ruby, whatever), so that I could have a look of other implementation, and would know how to improve current. Too bad though, but i can't find any other open source project!! So i am little stuck here, actually :)

Oct 26, 2009 at 7:32 AM

Good Work :)

The new trunk version really fast like  the last stable .

Thanks again.

Coordinator
Oct 26, 2009 at 8:49 AM

Great!   I worked yesterday all day, and implemented QuadTrees for cell spanning algorithms.

For comparison, to find a spanned cell range with simple IList<Range> and with total of 30 000 ranges, it takes around 90 000 ms. That's 90 seconds, which is alot.

With proper quad tree implementation the same amount of work is finished in ~ 1600 ms :)   And that's only 1.6 seconds. Around  60 times faster. Not bad.

I also speedup cell creation, so now sample 04 builds around twice faster than previously.


Please test if new version is working fine.  I will soon release a release candidate version :)

 

 

Oct 26, 2009 at 9:52 AM

Good Work really , a great progress for performance  :)

i tested all samples and all work fine  , also i tested the devxpress added components and they works fine :)

Unfortunately, an exception throwed (span exception) when i tried to upgrade my work project to the new reference  :( , at the last version , my code work well but with this version span didn't work   , i uploaded the code describe an example  ( can be getted from here : http://rapidshare.com/files/298075770/WindowsFormsApplication4.rar ) , i hope it clear to be resolved :)

Oct 26, 2009 at 11:01 AM
Great job! I can't wait to try it!
Derek
Coordinator
Oct 26, 2009 at 11:42 AM
borchanii wrote:

Unfortunately, an exception throwed (span exception) when i tried to upgrade my work project to the new reference  :( , at the last version , my code work well but with this version span didn't work   , i uploaded the code describe an example  ( can be getted from here : http://rapidshare.com/files/298075770/WindowsFormsApplication4.rar ) , i hope it clear to be resolved :)

Borchanii, your example does not start, i get the following error:

System.IO.FileNotFoundException: Could not load file or assembly 'DevExpress.Utils.v9.2, Version=9.2.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a' or one of its dependencies. The system cannot find the file specified.
   at SourceGrid.CustomScrollControl..ctor()
   at SourceGrid.GridVirtual..ctor()
   at SourceGrid.Grid..ctor()
   at WindowsFormsApplication4.Form1.InitializeComponent() in c:\Documents and Settings\ltdda\Desktop\WindowsFormsApplication4\WindowsFormsApplication4\WindowsFormsApplication4\Form1.Designer.cs:line 31

 

Could you please include all necessary dlls in your rar file as well? I would then not have to spend a lot of time trying to reproduce your bug

Oct 26, 2009 at 1:54 PM

Sorry for this , i forget that i uploaded the modified dll

the code is simple to reproduce , just i added a grid to a form and i tried to initialize it like that :

 

int integer = 5;
            _GridRech.Redim(3, integer);
                _GridRech.FixedRows = 1;
                 SourceGrid.Cells.ColumnHeader col = new SourceGrid.Cells.ColumnHeader("Recherche");
                 col.ColumnSpan = integer;
                col.View.TextAlignment = DevAge.Drawing.ContentAlignment.MiddleCenter;
                col.AutomaticSortEnabled = false;
                col.ResizeEnabled = false ;
                _GridRech[0, 0] = col;

 

i reuploaded the simple from here :

http://rapidshare.com/files/298157323/WindowsFormsApplication4.zip

 

i hope it clear.

 

Oct 26, 2009 at 2:37 PM
Edited Oct 26, 2009 at 2:39 PM

 

I think i Understood the problem , in my case i don't use the span theory directly from the grid , i define a standalone ColumnHeader , i affect my span ( there the question : how to  UpdateSpannedArea for my grid ? ) , so when i affect this column to a cell from my grid  , an exception is throwed because the span area is not updated

, like what you sayed :

// if the item is not contained in this quad, there's a problem
if (!m_bounds.Contains(item))
{
throw new ArgumentException("range is out of the bounds of this quadtree node");
}

 

so , i think a update must be somewhere when an affectation to a cell is done  for the  UpdateSpannedArea , isn't?

 

Oct 27, 2009 at 10:21 AM

Also , i think the call of function AutoSizeCells() is slower than before  , the application lost its performance while calling it several times.

Coordinator
Nov 2, 2009 at 6:17 AM

Hi borchanii, i didn't find yet time to catch your bug, and have a look at AutoSizeCells().  Maybe next weekend.

Nov 2, 2009 at 9:34 AM

No problem , i adapted my project to the new dll , i removed the span from standalone column (span must be like grid[i,j].ColumnSpan=number) , also , i removed the use of the AutoSizeCells() from my project by defining my own columns' width .

I ' am using the new version and it'is stable and work fine still now  , thanks for update :)

Coordinator
Nov 3, 2009 at 11:31 AM

Ok!

So do you think there is a bug, or was it simply a bug in your code?

Should i release new version, or are there any pending problems?

Nov 3, 2009 at 4:07 PM

It is a bug should be resolved for this case : when  you use span from stand alone column , an exception is handled (like the exemple writed befaure  , easy to reproduce  ) , people can skip this problem by using span directly from the grid

also , the autosizecells() is slower than befaure , also can skipped by people by defining their own width

Except that   , the grid work well :)

  People can migrate to this new version but may be they need to modify their code a little to skip the use of this two cases .

Nov 4, 2009 at 8:47 AM

Hi !

I'm experiencing the same problem. With this update many of my spanning problems seems to be solved (row insertion and removal), except when I use that:

colHeaders[i].ColumnSpan = ...

where colHeaders[i] is a SourceGrid.Cells.ColumnHeader object.

For a generic ASCII file editor I'm managing several line types with several column numbers and I often "play" with spanning.
But when I define my columns, which depend on the file format, I don't already know on which line this header will be inserted and I can't use grid[i, j].ColumnSpan = ... as said borchanii.

Darius, Do you understand the problem and do you think, with your new spanning management, that Column.ColumnSpan = will be possible, or the row number is absolutely needed and I've to look for a "workaround" in my project?

Thanks very much for all the work !

 

Nov 4, 2009 at 8:51 AM

Note: in my project this new version is about 2 times slower that the previous one (6-8 seconds for ~10000 lines with some spanned, 3-4 before).

Coordinator
Nov 4, 2009 at 10:46 AM

Ok, then i will fix the issue with spanning first.

 

Jray, so you say that the new version is slower, not faster?   If yes, could you please send me some function, which would show such slow performance? (like the one you create 10k lines, for example). I would look at this, and maybe suggest something

 

Nov 4, 2009 at 11:46 AM
Edited Nov 4, 2009 at 3:04 PM

I've another little problem, but it need to do more tests: when I insert a new row above a spanned row, I get an overlapping cells problem "Can not change span". If I set AllowOverlappingCells = true it's OK, but I don't know if it could generate further problems...

For the performance, I'll do some more tests with release version to be sure and I tell you again. Give an example is unfortunately not so easy because the grid is populated with content read in a file depending on this file format, which is defined in XML. So extact a little example with code only relative to SourceGrid isn't so easy.

Note: as I said, I'll make so more texts, but my comparison is between the current version and the "temporary" one (with AllowOverlappingCells = true) of july 09, not the last stable!

Coordinator
Nov 5, 2009 at 10:54 AM

>> Note: as I said, I'll make so more texts, but my comparison is between the current version and the "temporary" one (with AllowOverlappingCells = true) of july 09, not the last stable!

Could you test with the latest version in trunk? 

 

 

P.s. AllowOverlappingCells will be removed soon, so do not rely on it

Nov 6, 2009 at 6:41 AM

It's what I've done: I now use SourceGrid 33499 (Oct 25).

But some problems with AllowOverlappingCells = false, eg when I insert a row with spanning upper an existing spanned row:

SourceGrid.OverlappingCellException occurred
  Message="Given cell at position (25, 2), intersects with another cell at position (26, 2) ''"
  Source="SourceGrid"
  StackTrace:
       at SourceGrid.Grid.EnsureNoSpannedCellsExist(Int32 row, Int32 col, ICell p_cell) in D:\PROJECTS\VS2008\_SourceGrid\SourceGrid4\SourceGrid\Grids\Grid.cs:line 336
  InnerException:

Even if I set all cells of the new row to null, I've problems with overlapping cells.If I insert a line with "grid.Rows.Insert()" and the create the cells, the exception above is thrown by grid[row, col].ColumnSpan = i (> 1).
So I think an update in the span table is still missing or made later ?
But the selection problem I've mentioned earlier is corrected, I mean I can now correctly select merged cells and the headers are correctly highlighted when I insert a remove spanned cells, so the update works for mouseMove, but there is still something with "EnsureNoSpannedCellsExist" on insertion.

Do I need to execute a special command when I add or remove a spanned cell ?

Nov 6, 2009 at 6:46 AM

About the performance, after making some little changes, compiling all the solution for Release and making new tests after restart, the performance seems to be the same as the old beta version (july) :)

Coordinator
Nov 8, 2009 at 5:11 PM

borchanii, i've fixed the problem. Now you can create cells even when it is detached from grid.

 

Jray, i will need more information to investigate performance problem

Coordinator
Nov 8, 2009 at 5:15 PM

P.s. the code is now in http://bitbucket.org/dariusdamalakas/sourcegrid/

In the future SourceGrid will switch from using CodePlex for source code to http://bitbucket.org/dariusdamalakas/sourcegrid/

The reason is that CodePlex offers terrible svn support, and the issues are not handled at all. Mercurial is also a decentralised versioning system, so it will be much more faster, and will provide more features to branch and improve code

Nov 9, 2009 at 6:28 AM

Thanks for update , it work well :)

Coordinator
Nov 11, 2009 at 10:10 AM

Good!

 

Jray, are you sure  that performance problem is in SourceGrid, and not because you call some function more times than you actually need?

Nov 12, 2009 at 2:57 PM
Judariusdamalakas wrote:

P.s. the code is now in http://bitbucket.org/dariusdamalakas/sourcegrid/

In the future SourceGrid will switch from using CodePlex for source code to http://bitbucket.org/dariusdamalakas/sourcegrid/

The reason is that CodePlex offers terrible svn support, and the issues are not handled at all. Mercurial is also a decentralised versioning system, so it will be much more faster, and will provide more features to branch and improve code

Just curious, why did you choose mercurial instead of git or bazaar, which seem more popular (I use git for the most part, bzr for some other projects)?

Frank

Coordinator
Nov 13, 2009 at 6:47 AM

please correct me if i am wrong, hg is my first try of dcvs, but my impressions was that git and bzr are both more for unix/linux environments. if you work on windows, then you have to work more to simply start using it.

I've just googled, and found that:

if you want to use git for windows, then either install it via cygwin, or use msysgit

if you want to use bzr, you can use http://bazaar-vcs.org/TortoiseBzr.    Ok, so it seems it is not that bad, as i was thinking. Sorry ;) 

Personally, i was most influenced by the fact that google code supports hg and whole OpenOffice team moves to hg very soon. So it seemed much more accepted that bzr and git, but it might be just my impressions only

 

 

Nov 13, 2009 at 7:40 AM

For me the problem when I try to insert a new spanned row where a spanned row already exists isn't crercted with the bitbucket.org version:

SourceGrid.OverlappingCellException was unhandled
  Message="Can not change span"
  Source="SourceGrid"
  StackTrace:
       at SourceGrid.Cells.Cell.SetSpan(Int32 rowSpan, Int32 colSpan) in D:\PROJECTS\VS2008\_SourceGrid\SourceGrid\SourceGrid\Cells\Cell.cs:line 217
       at SourceGrid.Cells.Cell.set_ColumnSpan(Int32 value) in D:\PROJECTS\VS2008\_SourceGrid\SourceGrid\SourceGrid\Cells\Cell.cs:line 233
       at ...
  InnerException: SourceGrid.OverlappingCellException
       Message="Given cell at position (16, 2), intersects with another cell at position (17, 2) ''"
       Source="SourceGrid"
       StackTrace:
            at SourceGrid.Grid.EnsureNoSpannedCellsExist(Int32 row, Int32 col, ICell p_cell) in D:\PROJECTS\VS2008\_SourceGrid\SourceGrid\SourceGrid\Grids\Grid.cs:line 336
            at SourceGrid.Grid.EnsureDestinationSpannedAreaIsEmptyExceptOriginalCell(Int32 row, Int32 col, ICell p_cell) in D:\PROJECTS\VS2008\_SourceGrid\SourceGrid\SourceGrid\Grids\Grid.cs:line 385
            at SourceGrid.Grid.OccupySpannedArea(Int32 row, Int32 col, ICell p_cell) in D:\PROJECTS\VS2008\_SourceGrid\SourceGrid\SourceGrid\Grids\Grid.cs:line 443
            at SourceGrid.Cells.Cell.SetSpan(Int32 rowSpan, Int32 colSpan) in D:\PROJECTS\VS2008\_SourceGrid\SourceGrid\SourceGrid\Cells\Cell.cs:line 209
       InnerException:

Coordinator
Nov 13, 2009 at 8:44 AM

Steps to reproduce the problem?

 

Nov 13, 2009 at 1:16 PM
dariusdamalakas wrote:

please correct me if i am wrong, hg is my first try of dcvs, but my impressions was that git and bzr are both more for unix/linux environments. if you work on windows, then you have to work more to simply start using it.

I've just googled, and found that:

if you want to use git for windows, then either install it via cygwin, or use msysgit

if you want to use bzr, you can use http://bazaar-vcs.org/TortoiseBzr.    Ok, so it seems it is not that bad, as i was thinking. Sorry ;) 

Personally, i was most influenced by the fact that google code supports hg and whole OpenOffice team moves to hg very soon. So it seemed much more accepted that bzr and git, but it might be just my impressions only

 

 

Git runs both under cygwin and standalone with msysgit. My actual choice is the cygwin version, which brings cygwin itself as a really powerful platform.

Bzr runs natively under windows (has an installer also) because it's a python application.

I personally prefer git because of its clear and powerful model, I find bzr a little more complicated because it's designed to accomodate more than one work model.

Git has github as a 'project' repository, bzr has launchpad as project repositories (similar to bitbucket). launchpad seems to be the most mature.

All this doesn't mean hg is crap, I'm interested in dvcs and was just curious about the reasons behind your choice.

Frank

Nov 14, 2009 at 9:09 AM

The assembly information is missed in the new version , the dll haven't any information (v 0.0.0.0 ) , just to be informed :)

 

Coordinator
Nov 14, 2009 at 11:20 AM
borchanii wrote:

The assembly information is missed in the new version , the dll haven't any information (v 0.0.0.0 ) , just to be informed :)

 

Added! Thanks :)

 

Coordinator
Nov 14, 2009 at 11:24 AM
strfrank wrote:

Git runs both under cygwin and standalone with msysgit. My actual choice is the cygwin version, which brings cygwin itself as a really powerful platform.

Bzr runs natively under windows (has an installer also) because it's a python application.

I personally prefer git because of its clear and powerful model, I find bzr a little more complicated because it's designed to accomodate more than one work model.

I forgot to mention that what matters alot is also how is it easy for newcomers to learn new versioning system. subversion is very popular, so no problems with it.  With git i think lot of people would have problem if they have not worked in linux/unix environments before.

But this thread is not for such talks :)

Nov 16, 2009 at 7:15 AM
Edited Nov 16, 2009 at 8:08 AM
dariusdamalakas wrote:

Steps to reproduce the problem?

 

// Insert row
grid.Rows.Insert(row);

            // Delete/empty existing row (to avoid problems with spanning) // This was mandatory with previous beta version, perhaps now not any more !!
            for (int col = grid.ColumnsCount - 1; col >= 0; col--)
                grid[row, col] = null;

            // Columns
            for (int col = 1; col <= ...; col++)
            {
                grid[row, col] = new SourceGrid.Cells.Cell(...);
                grid[row, col].View = ...;
               grid[row, col].ColumnSpan = ...;
            }

Exception with ".ColumnSpan = " (if > 1) if the row #[row] was previously already a spanned row.

 

Nov 16, 2009 at 3:54 PM
Edited May 7, 2010 at 1:29 AM

Did you have tried TortoiseSVN <cite>tortoisesvn.tigris.org</cite>

It has solved the problem with folder movement and other thing that you mention... what do you use from SVN in codeplex? the web interface?

you can configure the tortoise client for access to codeplex's SVN, i have tried but only in readonly, but i ve used with other servers and rocks!. i thinks that isnt a good idea to change to other server, codeplex is very clean and userfriendly and is good to have all in the same place.

I will wait for your feedback

Coordinator
Nov 17, 2009 at 11:16 AM
Edited May 8, 2010 at 6:13 AM
braian87b wrote:

Did you have tried TortoiseSVN <cite>tortoisesvn.tigris.org</cite>

It has solved the problem with folder movement and other thing that you mention... what do you use from SVN in codeplex? the web interface?

you can configure the tortoise client for access to codeplex's SVN, i have tried but only in readonly, but i ve used with other servers and rocks!. i thinks that isnt a good idea to change to other server, codeplex is very clean and userfriendly and is good to have all in the same place.

I will wait for your feedback

Greetings!

I moved discussion into this thread: http://sourcegrid.codeplex.com/Thread/View.aspx?ThreadId=75342

 

Coordinator
Nov 17, 2009 at 11:32 AM
jray wrote:

// Insert row
grid.Rows.Insert(row);

            // Delete/empty existing row (to avoid problems with spanning) // This was mandatory with previous beta version, perhaps now not any more !!
            for (int col = grid.ColumnsCount - 1; col >= 0; col--)
                grid[row, col] = null;

            // Columns
            for (int col = 1; col <= ...; col++)
            {
                grid[row, col] = new SourceGrid.Cells.Cell(...);
                grid[row, col].View = ...;
               grid[row, col].ColumnSpan = ...;
            }

Exception with ".ColumnSpan = " (if > 1) if the row #[row] was previously already a spanned row.

 

Jray, your code must throw exception :)  Imge that row = 5;

The first cell will be in position (5,1) with ColumnSpan 2.   So that means if we try to add cell to position (5, 2) then we will get an exception. This is exactly what is happening with your given code example

Nov 24, 2009 at 1:53 PM

Yes you're right, my sample isn't very pretty.

But if a use, for example, a while loop and increment col with "col += grid[row, col].ColumnSpan;", I still have the problem on the first where I set ColumnSpan = ... (> 1).

In fact, the problem happens only when I insert a row where the previous one already had spanning, so I would say that there is still an update problem in the spanned cells table.

 

An example that should be better (not very pretty but shows the problem):

        private void Form1_Load(object sender, EventArgs e)
        {
            int rowCount = 10, colCount = 10;
            grid.Redim(rowCount, colCount);

            SourceGrid.Cells.Views.Cell captionModel = new SourceGrid.Cells.Views.Cell();

            int r;
            for (r = 0; r < rowCount; r++)
            {
                for (int c = 0; c < colCount; c++)
                {
                    if (r == 5 && c == 3)
                    {
                        grid[r, c] = new SourceGrid.Cells.Cell("Cell " + r.ToString() + ":" + c.ToString());
                        grid[r, c].ColumnSpan = 3;
                        c += 2;
                    }
                    else
                        grid[r, c] = new SourceGrid.Cells.Cell("Cell " + r.ToString() + ":" + c.ToString());
                    
                }
            }

            r = 6;
            grid.Rows.Insert(r);
            for (int c = 0; c < colCount; c++)
            {
                if (c == 3)
                {
                    grid[r, c] = new SourceGrid.Cells.Cell("Cell " + r.ToString() + ":" + c.ToString());
                    grid[r, c].ColumnSpan = 3;
                    c += 2;
                }
                else
                    grid[r, c] = new SourceGrid.Cells.Cell("Cell " + r.ToString() + ":" + c.ToString());
            }

        }

 

The upper code works. if you change "r = 6" in the middle with "r = 5", it throws an Exception ("can not change span").

But if I'm right, the row #5 shouldn't have any span if I made an insertion.

Thanks

Coordinator
Nov 25, 2009 at 1:23 PM

Jray, thanks! I've finally managed to reproduce this bug.

I've actually created a test case to reproduce this :  SourceGrid.Tests.TestGrid_Span.Bug0003

Sorry for the bug :)