|
-
Aug 18th, 2013, 06:17 AM
#26
Re: Passing Array of Strings Between ViB and C
 Originally Posted by Niya
I will not waste my time trying to hack VB6 in an effort to fit a square peg in a round hole. Its far easier to simply write the damn thing in C++.
Nope, VB6-code for fast String-processing (when dealing at the char-value-level) is not much different from C++-routines (and Char-Array-usage there).
 Originally Posted by Niya
String processing isn't the only thing VB6 suffers at(barring the mentioned techniques).
VB6 does *not* suffer at String-processing, even when you take the SafeArray-approach away - since it is dead-easy to e.g.
start (for example when working on files) already with Char-Arrays in the first place - and then there's always the possibility to cast
a BSTR-copy into a ByteArray directly. And for many (most) scenarios VBs Instr-function or Split/Join and the Mid-statement are already fast enough.
 Originally Posted by Niya
I also had experience with its terrible performance with image processing.
As with your statement about string-processing-speed above - to image-processing I will say the same -
VB6-native-compiler output works at the level of the VC++ compiler version 6.
And thus, if you experienced "terrible performance with image processing", then it was definitely your fault, not the fault of the VB6-language or -compiler.
 Originally Posted by Niya
I just needed a couple of functions to do some simple blending effects and some colour matching if I remembered correctly.
My initial attempts in VB6 yielded disastrous performance.
I ended up porting most of the image processing to a C++ library and saw significant improvement in performance.
Post your C++ lib with some of your "blending or color-matching ops" - and I'm sure we can show you, how it's done properly in VB6.
 Originally Posted by Niya
VB6 has way too much overhead for these types of algorithms to work efficiently without hacking.
A blurry statement that, sorry to say... not sure what exactly is so difficult to understand in, that VB6 can compile roughly to the same speed-level as VC++6.
 Originally Posted by Niya
If you can hack your way around it, then more power to you.
Not sure what you mean with "hacking" - is it the usage of pointers in VB (you know, the same things you do when writing C++ code)?
Seems you are of the opinion, that when you work with pointers in C++, then it's "a nice, clean and fast way" - but when you use basically
the same Pointer-approach in VB6 per VartPtr/StrPtr & Co, then it is suddenly an "evil hack".
 Originally Posted by Niya
But if you are capable of writing them in C/C++ then I'd strongly recommend it as the better approach. I endorse the OP's approach as the better approach if she's indeed seeking performance by using C++.
Writing fast routines requires first and foremost *experience*, no matter what language (especially then, when the languages in question are pretty close since they compile already "natively").
It is the developer who decides (in the end) how fast an algorithms implementation is capable to work. I mean, you should have been able to come up with that on your own,
just from the example I've posted ...
I'm not sure if Cristina is able to work already at the level of the experienced MS-developers which implemented the original C++ based Replace-function in the VB6-runtime -
If she has more experience with VB6, then there's a very good chance, that she's able to write something faster directly in VB6 (with some guidance here in the Forum).
Olaf
Last edited by Schmidt; Aug 18th, 2013 at 07:39 AM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|