PureBasic Forum
https://www.purebasic.fr/english/

2D to 3D scanner converter software
https://www.purebasic.fr/english/viewtopic.php?f=35&t=69676
Page 1 of 1

Author:  marc_256 [ Thu Nov 23, 2017 4:30 pm ]
Post subject:  2D to 3D scanner converter software

hello,

< COPY OF MY POST HERE >
http://www.purebasic.fr/english/viewtopic.php?f=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...

Author:  Tenaja [ Thu Nov 30, 2017 9:18 pm ]
Post subject:  Re: 2D to 3D scanner converter software

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.

Author:  Thorium [ Tue Jan 23, 2018 5:02 pm ]
Post subject:  Re: 2D to 3D scanner converter software

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.

Page 1 of 1 All times are UTC + 1 hour
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/