I need to create PostScript output from our system. Our system produces highly formatted documents to numerous formats and I need to add .ps as an additional format.
One bit of weirdness, our code is all written in Java and we use IKVM for the .net version of our library. We have about 5% of the code written in C# and the rest is Java converted with IKVM.
I create .ps files on the Java side using a library that allows me to write to a Graphics2D object it provides. Unfortunately, in .NET (via IKVM) it's horribly slow.
So, to solve this, I'm thinking:
I appreciate any feedback on solving this problem.
We’ll be creating a branch of IKVM (tentative name Windward MVKI) and we’ll put it up on NuGet.
The issue we found is in converter.cs – C2J.ConvertShape(). It accesses path.PathPoints[i]. The problem is on each call to that it creates the array of points. Moving the call to PathPoints outside the for loop and then accessing the copy of the array built once to access speeds it up – a lot.
In other words:
for (int i = 0; i < points.Length; i++) {
PointF point = path.PathPoints[i];
Is changed to:
PointF[] points = path.PathPoints;
for (int i = 0; i < points.Length; i++) {
PointF point = points[i];