2D to 3D scanner converter software

Bare metal programming in PureBasic, for experienced users
marc_256
Enthusiast
Enthusiast
Posts: 735
Joined: Thu May 06, 2010 10:16 am
Location: Belgium
Contact:

2D to 3D scanner converter software

Post by marc_256 »

hello,

< COPY OF MY POST HERE >
http://www.purebasic.fr/english/viewtop ... 36&t=64446


For my 2D to 3D image converter, (cancer research)
I convert 2D bmp images to a 3D pixels cloud.
To do that I use a self made algorithm, written in PB.
It work very well but it need about 3...4 minutes to do the conversion. (see below)
So, will there be a significant difference in time when I rewrite my program in ASM ?
thanks,

marco


Image

Sorry, I do not use ogre for this one,
I just convert data to build a 2D image, who gives a 3D impression...
- every professional was once an amateur - greetings from Pajottenland - Belgium -
PS: sorry for my english I speak flemish ...
User avatar
Tenaja
Addict
Addict
Posts: 1948
Joined: Tue Nov 09, 2010 10:15 pm

Re: 2D to 3D scanner converter software

Post by Tenaja »

marc_256 wrote:will there be a significant difference in time when I rewrite my program in ASM ?
Yes, rewriting to asm takes a lot of time. :mrgreen:

More seriously, your question is like asking how long is a piece of string. It really boils down to how well your code is written, and what it does. If you have great code, converting to asm will only give you a 2x or maybe 4x speed boost. There are some things that pb is very slow at, such as strings, but the libraries are compiled in C by Fred, and simple math type calculations will not be much slower than C. If you are passing a lot of data through function calls, make sure you are using pointers if possible rather than lots of parameters.

What I recommend is you run your program using the resource monitor; it is a powerful tool. You can see which functions are called the most often, then optimize those. I think you can also see how much time is spent in a function. It's been a while since I have used it, but when I needed it, it was awesome.

This is based on the assumption that you aren't wanting to share code for us to critique, since you did not already post it.
Thorium
Addict
Addict
Posts: 1271
Joined: Sat Aug 15, 2009 6:59 pm

Re: 2D to 3D scanner converter software

Post by Thorium »

Without knowing how the algorithm works it's hard to answer.
However knowing you did it in PureBasic the answer is probably yes it will run faster. How much is impossible to answer before we know more about your algorithm. Most importantly: Can it be parallelized to take advantage of the SIMD unit of the CPU. If yes, we could see performance improvements of 10x and more.
Post Reply