RE: Speed of Applications in VBA vs VB
- From: Mark HOlcomb <MarkHOlcomb@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Thu, 20 Apr 2006 13:43:02 -0700
Thanks for the response. I wondered if VBA was slower than VB but I gather
from the responses that it is just me. Yes. 4 bytes at at time is not right.
This is a unix binary file so I have been timidly picking my way through it.
Now that I have it decoded I will try and read it into memory (I think the
streamreader is the way?).
Dos thinks it is one long string (I believe) so I am hoping I can somehow
read big chunks into memory then decode long strings ... this is all new
teritory for me.
"Tom Ogilvy" wrote:
I just wrote a 2.5MB file from excel using a binary write and it was almost.
instantaneous. I did it in one write. I would suspect reading would be
faster or comparable. I imagine you problem is your implementation which
won't improve switching to something else. 4 bytes at a time would be slow
I would suspect and probably isn't necessary.
--
Regards,
Tom Ogilvy
"Mark HOlcomb" wrote:
I have turned all of the screen updataing an auto recaluating toggles off.
I'm not really using the spread*** yet and it doent make much difference
at this point. I appreciate the feedback. Thanks
Mark
"Jim Thomlinson" wrote:
I look forward to finding out your results. The commercial code is probably
written in C/C++ which is quite a bit faster than VB. Without seeing your
code one of the biggest cuplrets that slow things down is the calculation
settings. If you are looping and the spread*** needs to recalc with each
loop it is going to be slow. Set your application.calculation to xlManual and
then back to xlAutomatic at the end. Deletes and inserts can be slow. Print
settings are slow.
Here is a good link to a site that help with tweaking perfomance...
http://www.decisionmodels.com/index.htm
--
HTH...
Jim Thomlinson
"Mark HOlcomb" wrote:
Thanks .. I have tried to make the code concise but it might be too big to
post.
There is a commerical code that reads the same binary file, but does it very
fast.
I'm missing somthing. I will try the streamreader. perhaps getting the data
into memory, as opposed to hitting the disk every 4 bytes will make a
difference.
I found that the built in math functions dec2hex and hex2dec slowed the code
down a lot. created my own functions to perform this task and made a huge
performance improvement. I will let you know about the streamreader ..
"Jim Thomlinson" wrote:
If I recall correctly the engine for VB is actually derived from VBA (which
seems backwards until you think about it). VB just wraps a bunch of
functionality around the VBA engine that is not available in VBA (creating
dll's and such). So converting to VB probably will not help. As for the
stream reader speeding things up... Give it a try and let me know.
Beyond that post your code and let some of the greater minds here have a
crack at it. Perhaps there are some code changes that will optimize your
speed.
--
HTH...
Jim Thomlinson
"Mark HOlcomb" wrote:
,I have written an application in VBA that reads a very large binary file.
I am pleased that it works at all .. but it runs too slow to be of any
practical use. I read 4 bytes at a time, then convert. The file is a
mixture of integer, ascii and floating point data. And very large. I want
to read several of these files in succession.
Would the stream reader speed things up? Or, if I transformed it into VB,
would it go faster? Is there an inheriant speed problem with VBA because it
is wrapped up in EXCEL? I only use VBA because I am most familiar with that
user interface.
Any comments are greatly appreciated.
Mark
- Follow-Ups:
- RE: Speed of Applications in VBA vs VB
- From: Tom Ogilvy
- RE: Speed of Applications in VBA vs VB
- References:
- RE: Speed of Applications in VBA vs VB
- From: Mark HOlcomb
- RE: Speed of Applications in VBA vs VB
- From: Tom Ogilvy
- RE: Speed of Applications in VBA vs VB
- Prev by Date: Re: Reference an individual row within a Column
- Next by Date: Re: Reposting - Help for Merging rows
- Previous by thread: RE: Speed of Applications in VBA vs VB
- Next by thread: RE: Speed of Applications in VBA vs VB
- Index(es):