Re: Help on sppeding up a 15,000 line batch process

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: VM (vonchi_m_at_yahoo.com)
Date: 04/15/04


Date: Thu, 15 Apr 2004 12:19:10 -0400

Thanks for your suggestion. Unfortunately, the "database" are a bunch of
proprietary files. Since everything's so prorietary, the only interface I
have to search for data is the DLL call and the struct that I use to pick up
the data.

But thanks anyway,
Vaughn

"Gary Hunt" <betaplace@codequest.co.uk> wrote in message
news:ewIBBssIEHA.3220@TK2MSFTNGP12.phx.gbl...
> Looking back at your original code - I think in this circumstance there
may
> be a "better" way.
>
> Am I right in saying that you are taking data from an SQL server or
> equivalent, putting it into a datatable and processing each row?
>
> Well if so - and if we've identified that it is the .Net String -> ANSI
> conversion that is taking the time then maybe we can get the data out of
the
> SQL server in ANSI format and never use unicode...
>
> It would be possible - and stop me if I'm butchering things too much
(hacker
> at heart!) - to use something like the following from SQL server which
would
> result in binary data we could put straight into the struct....
>
> SELECT CAST([fbu] AS varbinary) AS fbu, CAST([del] AS varbinary) AS del,
> CAST([cty] AS varbinary) AS cty, CAST([z4] AS varbinary) AS z4 FROM
[table]
>
> This will result in a datatable / sqldatareader that now has ANSI data in
> the columns. They will be presented as byte arrays which is exactly what
an
> ANSI string is.
>
> What do you think - too much of a fudge or an acceptable performance
> compromise...
>
> There are other items that would need to be changed as you are marshalling
> as TStr's which have their length before the data itself - so the class
> would look like
> byte iprubLen;
> byte[] iprubLen;
>
> Dunno - just think out loud I guess...
>
> g
>
>
> "Michael Giagnocavo [MVP]" <mggUNSPAM@Atrevido.net> wrote in message
> news:OgsffhlIEHA.3128@TK2MSFTNGP10.phx.gbl...
> > Are you only using ASCII (7-bits)? If so, perhaps you can do your own
> > marshalling and speed it up (assuming that the marshaller is converting
> > unicode to some different codepage). The reason being that going to
ascii
> is
> > simply taking the first 7bits, while true encoding conversion is more
> > involved.
> >
> > Perhaps you should summarize the problem now that you've narrowed it
down
> > (right?) and post to ms.public.dotnet.framework.performance.
> >
> > -Michael
> > MVP
> >
> > "VM" <vonchi_m@yahoo.com> wrote in message
> > news:%23wGVvlkIEHA.2164@TK2MSFTNGP12.phx.gbl...
> > > So assuming it just accepts ANSI, would it be possible that calling
this
> > > DLL
> > > function (made in C) from within a C application is so much faster
than
> > > converting the C-struct to C# and marshalling the data for the
interop?
> > > The previous version (made in C) did the whole process in less than 4
> > > mins.
> > > while the C# version takes over 30 mins.
> > >
> > > Vaughn
> > >
> > > "Michael Giagnocavo [MVP]" <mggUNSPAM@Atrevido.net> wrote in message
> > > news:uClF4SkIEHA.2236@TK2MSFTNGP10.phx.gbl...
> > >> If the unmanaged code is expecting ANSI, and you pass Unicode, it's
> just
> > >> going to mess up :(.
> > >> -mike
> > >> MVP
> > >>
> > >> "VM" <vonchi_m@yahoo.com> wrote in message
> > >> news:OC5GHFjIEHA.1220@tk2msftngp13.phx.gbl...
> > >> > If I use Unicode and the struct doesn't have legible data (after
> being
> > >> > modified), then I must use ANSI? Isn't there some way to cast the
> data
> > > so
> >
>
>



Relevant Pages

  • ODBC 3.0 and unicode
    ... I have a code that works with ODBC 3.0 and SQL server 2000, ... I need to convert my code from ansi to unicode, ...
    (microsoft.public.data.odbc)
  • Re: sendStringParameterAsUnicode: How to insert unicode data corre
    ... After checking with Microsoft it turns out that transmitting Unicode ... requires a change in the data format sent to the JDBC Receiver channel. ... We have contacted SAP and Microsoft. ... We are using SAP XI and connecting it to SQL Server 2005 using JDBC. ...
    (microsoft.public.sqlserver.jdbcdriver)
  • Re: Call C DLL from VB.net-problem..array gains 4 bytes!
    ... No, Unicode strings don't, by definition, have a header with the size. ... you're writing code in C++, for example, the only difference between an ANSI ... which take an array of bytes. ... > Remember the DLL declaration... ...
    (microsoft.public.windowsce.app.development)
  • Re: Why use other encoding then UTF-8 when this support almost every language
    ... But for most of them the Unicode standard ... Eventually this OEM free-for-all got codified in the ANSI standard. ... characters, noncharacter, etc. ...
    (microsoft.public.dotnet.languages.csharp)