Improve comments and style
↧
Source code checked in, #96e734eab671
↧
Source code checked in, #9e1f5205e5d5
Correct compiler warnings in PngDecoder/BmpDecoder.
Change IImageDecoder.Decode method signature.
↧
↧
Commented Unassigned: incorrect and missing points rendered from LineSeries [10170]
In RederingExtensions the:
* First point is always added regardless of whether it's inside the clipping region or not
* First point of every clipped line segment is skipped
In addition, there are a couple of performance issues:
* Boxing is occurring on every ScreenPoint
* New lists are constantly being created instead of just clearing the old list
I think I fixed the issues (see attached). I also added another performance improvement of injecting the intermediate output buffer for ScreenPoints. This prevents the buffer from constantly copying itself and stressing 3rd generation garbage collection. This may be able to be omitted in lieu of presizing the buffer. However, I chose the less clean interface to reduce the risk of garbage collection killing our app. This is just for our stuff, since we're rendering millions of points using MVVM. The garbage collector was actually killing our application performance due to Oxyplot (we run an instrument and it was shutting our data collection down). _BTW, do I need to copy your copyright into the attached file, or is it OK to just simply include the license file in our distribution & installer?_
I actually have permission to give you the full source that allows us to render millions of points using MVVM if you desire. You could incorporate everything but data appendage into your project without messing things up too much. There are a few things that you could do cleaner by having it in your source. I have some code for data appendage also, which doesn't require any series to be redrawn, but has some extra state to manage. Just let me know if you would like any of this.
Comments: I refactored the DrawClippedLine based on your suggestions (inlining the point equals method and providing an output buffer), but I did not see much improvement on performance. Can you review the changes? See the new PerformanceTest application. I ran the test in the Ants profiler and found that the current bottleneck is the CohenSutherlandClipping.ComputeOutCode method. Maybe this should be inlined (manually)? I think the MethodImplOptions.AggressiveInlining is not available for the PCL profile we are using.
* First point is always added regardless of whether it's inside the clipping region or not
* First point of every clipped line segment is skipped
In addition, there are a couple of performance issues:
* Boxing is occurring on every ScreenPoint
* New lists are constantly being created instead of just clearing the old list
I think I fixed the issues (see attached). I also added another performance improvement of injecting the intermediate output buffer for ScreenPoints. This prevents the buffer from constantly copying itself and stressing 3rd generation garbage collection. This may be able to be omitted in lieu of presizing the buffer. However, I chose the less clean interface to reduce the risk of garbage collection killing our app. This is just for our stuff, since we're rendering millions of points using MVVM. The garbage collector was actually killing our application performance due to Oxyplot (we run an instrument and it was shutting our data collection down). _BTW, do I need to copy your copyright into the attached file, or is it OK to just simply include the license file in our distribution & installer?_
I actually have permission to give you the full source that allows us to render millions of points using MVVM if you desire. You could incorporate everything but data appendage into your project without messing things up too much. There are a few things that you could do cleaner by having it in your source. I have some code for data appendage also, which doesn't require any series to be redrawn, but has some extra state to manage. Just let me know if you would like any of this.
Comments: I refactored the DrawClippedLine based on your suggestions (inlining the point equals method and providing an output buffer), but I did not see much improvement on performance. Can you review the changes? See the new PerformanceTest application. I ran the test in the Ants profiler and found that the current bottleneck is the CohenSutherlandClipping.ComputeOutCode method. Maybe this should be inlined (manually)? I think the MethodImplOptions.AggressiveInlining is not available for the PCL profile we are using.
↧
Commented Unassigned: DateTime axis value overlaped for large data. [10169]
Hi,
DateTime axis value overlapped for large data. Please refer attachment snapshot.
Please suggest solution for it.
Thanks...
Comments: Hi benhysell, I am plotting data dynamically, data is added to chart on each second till 15 mins and want to show only 10 points on the chart. How do I do it ? Thanks...
DateTime axis value overlapped for large data. Please refer attachment snapshot.
Please suggest solution for it.
Thanks...
Comments: Hi benhysell, I am plotting data dynamically, data is added to chart on each second till 15 mins and want to show only 10 points on the chart. How do I do it ? Thanks...
↧
Created Unassigned: No responce while plotting same point in large number. [10171]
Hello,
Thanks again for this great library.
I have a problem while plotting Line series.
Generally the library works fine.
At some scenario, my application have huge collection of same point to be plotted on plot.
As the count of collection increases, the rendering of plot becomes slower,
As some point, it completely not responding.
Here is my dummy method to populate plot model.
```
public PlotModel GetPlotModel()
{
int numberOfPoints = 100000;
var series = new LineSeries();
var plotModel = new PlotModel(string.Format("{0} (n={1})", series.Title, numberOfPoints));
for (int i = 0; i < numberOfPoints; i++)
{
series.Points.Add(new ScatterPoint(1000, 1000));
}
plotModel.Series.Add(series);
return plotModel;
}
```
Please help me to solve this issue.
Thanks.
Thanks again for this great library.
I have a problem while plotting Line series.
Generally the library works fine.
At some scenario, my application have huge collection of same point to be plotted on plot.
As the count of collection increases, the rendering of plot becomes slower,
As some point, it completely not responding.
Here is my dummy method to populate plot model.
```
public PlotModel GetPlotModel()
{
int numberOfPoints = 100000;
var series = new LineSeries();
var plotModel = new PlotModel(string.Format("{0} (n={1})", series.Title, numberOfPoints));
for (int i = 0; i < numberOfPoints; i++)
{
series.Points.Add(new ScatterPoint(1000, 1000));
}
plotModel.Series.Add(series);
return plotModel;
}
```
Please help me to solve this issue.
Thanks.
↧
↧
Edited Unassigned: No response while plotting same point in large number. [10171]
Hello,
Thanks again for this great library.
I have a problem while plotting Line series.
Generally the library works fine.
At some scenario, my application have huge collection of same point to be plotted on plot.
As the count of collection increases, the rendering of plot becomes slower,
As some point, it completely not responding.
Here is my dummy method to populate plot model.
```
public PlotModel GetPlotModel()
{
int numberOfPoints = 100000;
var series = new LineSeries();
var plotModel = new PlotModel(string.Format("{0} (n={1})", series.Title, numberOfPoints));
for (int i = 0; i < numberOfPoints; i++)
{
series.Points.Add(new ScatterPoint(1000, 1000));
}
plotModel.Series.Add(series);
return plotModel;
}
```
Please help me to solve this issue.
Thanks.
Thanks again for this great library.
I have a problem while plotting Line series.
Generally the library works fine.
At some scenario, my application have huge collection of same point to be plotted on plot.
As the count of collection increases, the rendering of plot becomes slower,
As some point, it completely not responding.
Here is my dummy method to populate plot model.
```
public PlotModel GetPlotModel()
{
int numberOfPoints = 100000;
var series = new LineSeries();
var plotModel = new PlotModel(string.Format("{0} (n={1})", series.Title, numberOfPoints));
for (int i = 0; i < numberOfPoints; i++)
{
series.Points.Add(new ScatterPoint(1000, 1000));
}
plotModel.Series.Add(series);
return plotModel;
}
```
Please help me to solve this issue.
Thanks.
↧
Edited Unassigned: No response while plotting same point in large number. [10171]
Hello,
Thanks again for this great library.
I have a problem while plotting Line series.
Generally the library works fine.
At some scenario, my application have huge collection of same point to be plotted on plot.
As the count of collection increases, the rendering of plot becomes slower,
As some point, it completely not responding.
Here is my dummy method to populate plot model.
``` C#
public PlotModel GetPlotModel()
{
int numberOfPoints = 100000;
var series = new LineSeries();
var title = string.Format("{0} (n={1})", series.Title, numberOfPoints);
var plotModel = new PlotModel(title);
for (int i = 0; i < numberOfPoints; i++)
{
series.Points.Add(new ScatterPoint(1000, 1000));
}
plotModel.Series.Add(series);
return plotModel;
}
```
Please help me to solve this issue.
Thanks.
Thanks again for this great library.
I have a problem while plotting Line series.
Generally the library works fine.
At some scenario, my application have huge collection of same point to be plotted on plot.
As the count of collection increases, the rendering of plot becomes slower,
As some point, it completely not responding.
Here is my dummy method to populate plot model.
``` C#
public PlotModel GetPlotModel()
{
int numberOfPoints = 100000;
var series = new LineSeries();
var title = string.Format("{0} (n={1})", series.Title, numberOfPoints);
var plotModel = new PlotModel(title);
for (int i = 0; i < numberOfPoints; i++)
{
series.Points.Add(new ScatterPoint(1000, 1000));
}
plotModel.Series.Add(series);
return plotModel;
}
```
Please help me to solve this issue.
Thanks.
↧
Commented Unassigned: incorrect and missing points rendered from LineSeries [10170]
In RederingExtensions the:
* First point is always added regardless of whether it's inside the clipping region or not
* First point of every clipped line segment is skipped
In addition, there are a couple of performance issues:
* Boxing is occurring on every ScreenPoint
* New lists are constantly being created instead of just clearing the old list
I think I fixed the issues (see attached). I also added another performance improvement of injecting the intermediate output buffer for ScreenPoints. This prevents the buffer from constantly copying itself and stressing 3rd generation garbage collection. This may be able to be omitted in lieu of presizing the buffer. However, I chose the less clean interface to reduce the risk of garbage collection killing our app. This is just for our stuff, since we're rendering millions of points using MVVM. The garbage collector was actually killing our application performance due to Oxyplot (we run an instrument and it was shutting our data collection down). _BTW, do I need to copy your copyright into the attached file, or is it OK to just simply include the license file in our distribution & installer?_
I actually have permission to give you the full source that allows us to render millions of points using MVVM if you desire. You could incorporate everything but data appendage into your project without messing things up too much. There are a few things that you could do cleaner by having it in your source. I have some code for data appendage also, which doesn't require any series to be redrawn, but has some extra state to manage. Just let me know if you would like any of this.
Comments: List.EnsureCapacity is what actually showed up on the profiler when I was testing. Simply just pre-allocating enough space may be good enough. You could probably get rid of the output buffer injection. I did make a comment that I wasn't sure it was needed in the code. There were a lot of places where large amounts of memory were being allocated. I just got rid of all of them because I suspect it was what was stressing the garbage collector to the point it was preventing our app from keeping up with data collection and signal processing. Simply having the plots showing would kill our data collection and the plots were mainly only using the UI thread, but were redrawing at about 4Hz. Previously, we had several locations in our app where we were definitely killing our signal processing due to over-stressing the garbage collector (_It actually killed off hyperthreading and reduced all cores to a max of 30-60% utilization before I added object pooling and other forms of memory reuse_). Since we were redrawing the plot quite often, I just naturally injected the output buffer while I was making the changes just to be safe. [MethodImplAttribute](http://msdn.microsoft.com/en-us/library/system.runtime.compilerservices.methodimplattribute.aspx)(MethodImplOptions) is supported by the PCL. I like your suggestion to on the other [discussion thread](https://oxyplot.codeplex.com/discussions/540699#post1228663). Maybe parallelizing the clipping before iterating through the clipped points might help. However, In my testing, with all my other changes, things got fast enough. Did you make your changes in the trunk?
* First point is always added regardless of whether it's inside the clipping region or not
* First point of every clipped line segment is skipped
In addition, there are a couple of performance issues:
* Boxing is occurring on every ScreenPoint
* New lists are constantly being created instead of just clearing the old list
I think I fixed the issues (see attached). I also added another performance improvement of injecting the intermediate output buffer for ScreenPoints. This prevents the buffer from constantly copying itself and stressing 3rd generation garbage collection. This may be able to be omitted in lieu of presizing the buffer. However, I chose the less clean interface to reduce the risk of garbage collection killing our app. This is just for our stuff, since we're rendering millions of points using MVVM. The garbage collector was actually killing our application performance due to Oxyplot (we run an instrument and it was shutting our data collection down). _BTW, do I need to copy your copyright into the attached file, or is it OK to just simply include the license file in our distribution & installer?_
I actually have permission to give you the full source that allows us to render millions of points using MVVM if you desire. You could incorporate everything but data appendage into your project without messing things up too much. There are a few things that you could do cleaner by having it in your source. I have some code for data appendage also, which doesn't require any series to be redrawn, but has some extra state to manage. Just let me know if you would like any of this.
Comments: List.EnsureCapacity is what actually showed up on the profiler when I was testing. Simply just pre-allocating enough space may be good enough. You could probably get rid of the output buffer injection. I did make a comment that I wasn't sure it was needed in the code. There were a lot of places where large amounts of memory were being allocated. I just got rid of all of them because I suspect it was what was stressing the garbage collector to the point it was preventing our app from keeping up with data collection and signal processing. Simply having the plots showing would kill our data collection and the plots were mainly only using the UI thread, but were redrawing at about 4Hz. Previously, we had several locations in our app where we were definitely killing our signal processing due to over-stressing the garbage collector (_It actually killed off hyperthreading and reduced all cores to a max of 30-60% utilization before I added object pooling and other forms of memory reuse_). Since we were redrawing the plot quite often, I just naturally injected the output buffer while I was making the changes just to be safe. [MethodImplAttribute](http://msdn.microsoft.com/en-us/library/system.runtime.compilerservices.methodimplattribute.aspx)(MethodImplOptions) is supported by the PCL. I like your suggestion to on the other [discussion thread](https://oxyplot.codeplex.com/discussions/540699#post1228663). Maybe parallelizing the clipping before iterating through the clipped points might help. However, In my testing, with all my other changes, things got fast enough. Did you make your changes in the trunk?
↧
Commented Unassigned: incorrect and missing points rendered from LineSeries [10170]
In RederingExtensions the:
* First point is always added regardless of whether it's inside the clipping region or not
* First point of every clipped line segment is skipped
In addition, there are a couple of performance issues:
* Boxing is occurring on every ScreenPoint
* New lists are constantly being created instead of just clearing the old list
I think I fixed the issues (see attached). I also added another performance improvement of injecting the intermediate output buffer for ScreenPoints. This prevents the buffer from constantly copying itself and stressing 3rd generation garbage collection. This may be able to be omitted in lieu of presizing the buffer. However, I chose the less clean interface to reduce the risk of garbage collection killing our app. This is just for our stuff, since we're rendering millions of points using MVVM. The garbage collector was actually killing our application performance due to Oxyplot (we run an instrument and it was shutting our data collection down). _BTW, do I need to copy your copyright into the attached file, or is it OK to just simply include the license file in our distribution & installer?_
I actually have permission to give you the full source that allows us to render millions of points using MVVM if you desire. You could incorporate everything but data appendage into your project without messing things up too much. There are a few things that you could do cleaner by having it in your source. I have some code for data appendage also, which doesn't require any series to be redrawn, but has some extra state to manage. Just let me know if you would like any of this.
Comments: Never-mind the question about where you made the changes. I saw the commit, I just haven't looked at it yet.
* First point is always added regardless of whether it's inside the clipping region or not
* First point of every clipped line segment is skipped
In addition, there are a couple of performance issues:
* Boxing is occurring on every ScreenPoint
* New lists are constantly being created instead of just clearing the old list
I think I fixed the issues (see attached). I also added another performance improvement of injecting the intermediate output buffer for ScreenPoints. This prevents the buffer from constantly copying itself and stressing 3rd generation garbage collection. This may be able to be omitted in lieu of presizing the buffer. However, I chose the less clean interface to reduce the risk of garbage collection killing our app. This is just for our stuff, since we're rendering millions of points using MVVM. The garbage collector was actually killing our application performance due to Oxyplot (we run an instrument and it was shutting our data collection down). _BTW, do I need to copy your copyright into the attached file, or is it OK to just simply include the license file in our distribution & installer?_
I actually have permission to give you the full source that allows us to render millions of points using MVVM if you desire. You could incorporate everything but data appendage into your project without messing things up too much. There are a few things that you could do cleaner by having it in your source. I have some code for data appendage also, which doesn't require any series to be redrawn, but has some extra state to manage. Just let me know if you would like any of this.
Comments: Never-mind the question about where you made the changes. I saw the commit, I just haven't looked at it yet.
↧
↧
Commented Unassigned: incorrect and missing points rendered from LineSeries [10170]
In RederingExtensions the:
* First point is always added regardless of whether it's inside the clipping region or not
* First point of every clipped line segment is skipped
In addition, there are a couple of performance issues:
* Boxing is occurring on every ScreenPoint
* New lists are constantly being created instead of just clearing the old list
I think I fixed the issues (see attached). I also added another performance improvement of injecting the intermediate output buffer for ScreenPoints. This prevents the buffer from constantly copying itself and stressing 3rd generation garbage collection. This may be able to be omitted in lieu of presizing the buffer. However, I chose the less clean interface to reduce the risk of garbage collection killing our app. This is just for our stuff, since we're rendering millions of points using MVVM. The garbage collector was actually killing our application performance due to Oxyplot (we run an instrument and it was shutting our data collection down). _BTW, do I need to copy your copyright into the attached file, or is it OK to just simply include the license file in our distribution & installer?_
I actually have permission to give you the full source that allows us to render millions of points using MVVM if you desire. You could incorporate everything but data appendage into your project without messing things up too much. There are a few things that you could do cleaner by having it in your source. I have some code for data appendage also, which doesn't require any series to be redrawn, but has some extra state to manage. Just let me know if you would like any of this.
Comments: Yes, the MethodImplAttribute is supported by PCL, but not the MethodImplOptions that we need. http://msdn.microsoft.com/en-us/library/system.runtime.compilerservices.methodimploptions(v=vs.110).aspx I tried casting from 256, but this did not seem to work :-) Could it be better to use an array for the points to draw? This means the drawing method also needs to get the number of points that should be drawn. The array can be static and fixed size (large) and there should be only some minor visual changes (different line joins where the array is full, and the line must be drawn before it is complete) Yes, I pushed the changes to the default, please review. Thanks for contributing, these are great improvements that increases performance on all platforms!
* First point is always added regardless of whether it's inside the clipping region or not
* First point of every clipped line segment is skipped
In addition, there are a couple of performance issues:
* Boxing is occurring on every ScreenPoint
* New lists are constantly being created instead of just clearing the old list
I think I fixed the issues (see attached). I also added another performance improvement of injecting the intermediate output buffer for ScreenPoints. This prevents the buffer from constantly copying itself and stressing 3rd generation garbage collection. This may be able to be omitted in lieu of presizing the buffer. However, I chose the less clean interface to reduce the risk of garbage collection killing our app. This is just for our stuff, since we're rendering millions of points using MVVM. The garbage collector was actually killing our application performance due to Oxyplot (we run an instrument and it was shutting our data collection down). _BTW, do I need to copy your copyright into the attached file, or is it OK to just simply include the license file in our distribution & installer?_
I actually have permission to give you the full source that allows us to render millions of points using MVVM if you desire. You could incorporate everything but data appendage into your project without messing things up too much. There are a few things that you could do cleaner by having it in your source. I have some code for data appendage also, which doesn't require any series to be redrawn, but has some extra state to manage. Just let me know if you would like any of this.
Comments: Yes, the MethodImplAttribute is supported by PCL, but not the MethodImplOptions that we need. http://msdn.microsoft.com/en-us/library/system.runtime.compilerservices.methodimploptions(v=vs.110).aspx I tried casting from 256, but this did not seem to work :-) Could it be better to use an array for the points to draw? This means the drawing method also needs to get the number of points that should be drawn. The array can be static and fixed size (large) and there should be only some minor visual changes (different line joins where the array is full, and the line must be drawn before it is complete) Yes, I pushed the changes to the default, please review. Thanks for contributing, these are great improvements that increases performance on all platforms!
↧
New Post: FileNotFoundException in XAML designer (Visual Studio 2012/2013)
Problem solved by installing Silverlight 5 SDK. Thanks!
↧
Created Unassigned: ToPdf extension method [10172]
The PlotModel has the ToSvg method. I was searching for the pdf export functionality and had to use one of the examples to find out how to do this.
I think it would be great if a small extension method could be added:
```
public static byte[] ToPdf(this PlotModel plotModel)
{
Argument.IsNotNull(() => plotModel);
return ToPdf(plotModel, plotModel.Width, plotModel.Height);
}
public static byte[] ToPdf(this PlotModel plotModel, double width, double height)
{
Argument.IsNotNull(() => plotModel);
using (var memoryStream = new MemoryStream())
{
PdfExporter.Export(plotModel, memoryStream, width, height);
return memoryStream.ToArray();
}
}
```
I think it would be great if a small extension method could be added:
```
public static byte[] ToPdf(this PlotModel plotModel)
{
Argument.IsNotNull(() => plotModel);
return ToPdf(plotModel, plotModel.Width, plotModel.Height);
}
public static byte[] ToPdf(this PlotModel plotModel, double width, double height)
{
Argument.IsNotNull(() => plotModel);
using (var memoryStream = new MemoryStream())
{
PdfExporter.Export(plotModel, memoryStream, width, height);
return memoryStream.ToArray();
}
}
```
↧
New Post: Tracker vs. Annotation
I just tried out OxyPlot yesterday so I don't have that much experience yet.
In the "Getting Started"-example (http://www.oxyplot.org/doc/HelloWpf.html) a Function Series is introduced, and a Tracker is shown in the resulting plot when pressing the left mouse button.
Instead of a Function Series, I would like to draw some polygons with a Tracker attached. I tried to add a Polygon Annotation showing nice polygons in the plot, but no Tracker is shown when pressing the left mouse button. Do I have to implement the polygons using Series or is there another way of getting the Tracker together with annotations? Do I miss something?
In the "Getting Started"-example (http://www.oxyplot.org/doc/HelloWpf.html) a Function Series is introduced, and a Tracker is shown in the resulting plot when pressing the left mouse button.
Instead of a Function Series, I would like to draw some polygons with a Tracker attached. I tried to add a Polygon Annotation showing nice polygons in the plot, but no Tracker is shown when pressing the left mouse button. Do I have to implement the polygons using Series or is there another way of getting the Tracker together with annotations? Do I miss something?
↧
↧
New Post: Tracker vs. Annotation
Annotations are (currently) not target for the tracker. The tracker only does hit testing on the series. I would suggest to create a custom PolygonSeries that implements the hit test method. The
AreaSeries is another alternative, but not as clean.↧
Commented Unassigned: incorrect and missing points rendered from LineSeries [10170]
In RederingExtensions the:
* First point is always added regardless of whether it's inside the clipping region or not
* First point of every clipped line segment is skipped
In addition, there are a couple of performance issues:
* Boxing is occurring on every ScreenPoint
* New lists are constantly being created instead of just clearing the old list
I think I fixed the issues (see attached). I also added another performance improvement of injecting the intermediate output buffer for ScreenPoints. This prevents the buffer from constantly copying itself and stressing 3rd generation garbage collection. This may be able to be omitted in lieu of presizing the buffer. However, I chose the less clean interface to reduce the risk of garbage collection killing our app. This is just for our stuff, since we're rendering millions of points using MVVM. The garbage collector was actually killing our application performance due to Oxyplot (we run an instrument and it was shutting our data collection down). _BTW, do I need to copy your copyright into the attached file, or is it OK to just simply include the license file in our distribution & installer?_
I actually have permission to give you the full source that allows us to render millions of points using MVVM if you desire. You could incorporate everything but data appendage into your project without messing things up too much. There are a few things that you could do cleaner by having it in your source. I have some code for data appendage also, which doesn't require any series to be redrawn, but has some extra state to manage. Just let me know if you would like any of this.
Comments: Hi it looks good. I see you found some stuff that I missed. However, I see that you decomposed the point down to x & y values in RenderingExtensions.DrawClippedLine. This creates an extra fetch for each iteration of the current and last value to then only grab out either the x or the y. Since ScreenPoint is a struct, using the whole point as a local variable is still a stack operation, so it would equate to storing the x & y corrdinates separately on the stack. However, having the whole point instead of each x & y values would create two less fetches from IList each cycle. I also see that the injected buffer is an IList<T>. Using this instead of the concrete List<T> removes the ability of the JIT compiler to inline code. It may (or may not) be better overall to remove the injected output buffer and just create a concrete list or array with the needed capacity. Along the same lines, I'm not sure how much using an internal array would contribute. If you did this, you could pass off ArraySegment<T>s to the same array to reuse memory. If you depend on List instead of IList, the JIT compiler can inline some stuff and the code is a little cleaner. However, again, I'm not sure how much either would contribute much to the overall performance. In my LineSeries, I have a static List<T> GetEmptyBuffer<T>(ref List<T> buffer, int size) that is used to get the rendering buffer among other buffers. If the buffer is not created yet, it will create one with the specified capacity. That helps quite a bit for the first render. See code below: ``` static List<T> GetEmptyBuffer<T>(ref List<T> buffer, int size) { if (buffer == null) return buffer = new List<T>(size); buffer.Clear(); return buffer; } ```
* First point is always added regardless of whether it's inside the clipping region or not
* First point of every clipped line segment is skipped
In addition, there are a couple of performance issues:
* Boxing is occurring on every ScreenPoint
* New lists are constantly being created instead of just clearing the old list
I think I fixed the issues (see attached). I also added another performance improvement of injecting the intermediate output buffer for ScreenPoints. This prevents the buffer from constantly copying itself and stressing 3rd generation garbage collection. This may be able to be omitted in lieu of presizing the buffer. However, I chose the less clean interface to reduce the risk of garbage collection killing our app. This is just for our stuff, since we're rendering millions of points using MVVM. The garbage collector was actually killing our application performance due to Oxyplot (we run an instrument and it was shutting our data collection down). _BTW, do I need to copy your copyright into the attached file, or is it OK to just simply include the license file in our distribution & installer?_
I actually have permission to give you the full source that allows us to render millions of points using MVVM if you desire. You could incorporate everything but data appendage into your project without messing things up too much. There are a few things that you could do cleaner by having it in your source. I have some code for data appendage also, which doesn't require any series to be redrawn, but has some extra state to manage. Just let me know if you would like any of this.
Comments: Hi it looks good. I see you found some stuff that I missed. However, I see that you decomposed the point down to x & y values in RenderingExtensions.DrawClippedLine. This creates an extra fetch for each iteration of the current and last value to then only grab out either the x or the y. Since ScreenPoint is a struct, using the whole point as a local variable is still a stack operation, so it would equate to storing the x & y corrdinates separately on the stack. However, having the whole point instead of each x & y values would create two less fetches from IList each cycle. I also see that the injected buffer is an IList<T>. Using this instead of the concrete List<T> removes the ability of the JIT compiler to inline code. It may (or may not) be better overall to remove the injected output buffer and just create a concrete list or array with the needed capacity. Along the same lines, I'm not sure how much using an internal array would contribute. If you did this, you could pass off ArraySegment<T>s to the same array to reuse memory. If you depend on List instead of IList, the JIT compiler can inline some stuff and the code is a little cleaner. However, again, I'm not sure how much either would contribute much to the overall performance. In my LineSeries, I have a static List<T> GetEmptyBuffer<T>(ref List<T> buffer, int size) that is used to get the rendering buffer among other buffers. If the buffer is not created yet, it will create one with the specified capacity. That helps quite a bit for the first render. See code below: ``` static List<T> GetEmptyBuffer<T>(ref List<T> buffer, int size) { if (buffer == null) return buffer = new List<T>(size); buffer.Clear(); return buffer; } ```
↧
New Post: Context menu broken in the latest Nuget package?
Has anything changed recently with respect to context menus?
The last working Nuget version is 2014.1.229.1. Since then context menus are broken. Has something changed or this is a bug?
The last working Nuget version is 2014.1.229.1. Since then context menus are broken. Has something changed or this is a bug?
↧
New Post: Tracker Position in Winforms
Hi,
Just started using oxyplot for winforms and so far so good.
The one issue I'm having is that on a column graph it seems the tracker position is not where I click. (see image below)
Image
I clicked on the middle column, and as you can see the tracker displays left and up of where I clicked
Am I doing something wrong?
Thanks
Just started using oxyplot for winforms and so far so good.
The one issue I'm having is that on a column graph it seems the tracker position is not where I click. (see image below)
Image
I clicked on the middle column, and as you can see the tracker displays left and up of where I clicked
Am I doing something wrong?
Thanks
↧
↧
New Post: Context menu broken in the latest Nuget package?
WPF or Silverlight? It is possible this was introduced when we added the "Plot controller" recently. For WPF I expect the bug to be in the
OxyPlot.Wpf.Plot.OnMouseUp method. We should add examples with context menu for both WPF and Silverlight.↧
New Post: Tracker Position in Winforms
The tracker should be shown at the mouse position. It works in the Winforms example browser. Can you create a simple Winforms example that reproduces this bug?
↧
New Post: Context menu broken in the latest Nuget package?
It was in WPF.
Yes I went to the Silverlight online example (http://www.oxyplot.org/examplebrowser) and tried to look for a "context menu" example to double check but could not find an entry.
Yes I went to the Silverlight online example (http://www.oxyplot.org/examplebrowser) and tried to look for a "context menu" example to double check but could not find an entry.
↧