Windows Vista Forums

out-file very slow
  1. #1


    Korbinian Stoemmer Guest

    out-file very slow

    Hi!

    I tried to dump my subversion repositories via a powershell-script.

    svnadmin dump $objItem.Fullname | out-file -encoding ASCII
    ('i:\temp\dumps\' + $objItem.Name + '.dump')

    this line is the one that does the dump.
    Now i noticed some major speed difference if i dumped the repositories
    via powershel or with the old cmd.exe .

    in the cmd.exe the dumping took about 3 minutes and in the powershell i
    took about 40 minutes. I believe it is because of the out-file which
    does by default a conversion to unicode.

    So: Is there a special trick to speed-up the out-file commandlet or an
    other commandlet which doesnt do the conversion to unicode (because i
    just need the output as ascii) ?



    thanks in advance

    Korbinian

      My System SpecsSystem Spec

  2. #2


    DBMwS Guest

    RE: out-file very slow

    "Korbinian Stoemmer" wrote:

    > Hi!
    >
    > I tried to dump my subversion repositories via a powershell-script.
    >
    > svnadmin dump $objItem.Fullname | out-file -encoding ASCII
    > ('i:\temp\dumps\' + $objItem.Name + '.dump')
    >
    > this line is the one that does the dump.
    > Now i noticed some major speed difference if i dumped the repositories
    > via powershel or with the old cmd.exe .
    >
    > in the cmd.exe the dumping took about 3 minutes and in the powershell i
    > took about 40 minutes. I believe it is because of the out-file which
    > does by default a conversion to unicode.
    >
    > So: Is there a special trick to speed-up the out-file commandlet or an
    > other commandlet which doesnt do the conversion to unicode (because i
    > just need the output as ascii) ?
    >
    > thanks in advance
    >
    > Korbinian
    >


    Instead of using just a one-liner to get your job done, why dont you try out
    the following?
    # create the file name first.
    $fileName = ('i:\temp\dumps\' + $objItem.Name + '.dump');
    # create an empty ASCII file & suppress output
    "" | out-file -Encoding ASCII | out-null
    # now you dont have to specify encoding style.(but not sure if this will
    speed up or not...
    svnadmin dump $objItem.Fullname | out-file 'i:\temp\dumps\' + $objItem.Name
    + '.dump')


    I haven't tested it out but.. hmm anyways, hope you could have tried that
    out since i am eager to know if creating a file first actually ignores
    "encoding" process or not

      My System SpecsSystem Spec

  3. #3


    DBMwS Guest

    RE: out-file very slow

    > # create an empty ASCII file & suppress output
    > "" | out-file -Encoding ASCII | out-null


    Woops i left out "$fileName" for "out-file"...
    # create an empty ASCII file & suppress output
    "" | out-file -Encoding ASCII $fileName | out-null


      My System SpecsSystem Spec

  4. #4


    dreeschkind Guest

    RE: out-file very slow

    "DBMwS" wrote:

    > "Korbinian Stoemmer" wrote:
    >
    > > Hi!
    > >
    > > I tried to dump my subversion repositories via a powershell-script.
    > >
    > > svnadmin dump $objItem.Fullname | out-file -encoding ASCII
    > > ('i:\temp\dumps\' + $objItem.Name + '.dump')
    > >
    > > this line is the one that does the dump.
    > > Now i noticed some major speed difference if i dumped the repositories
    > > via powershel or with the old cmd.exe .
    > >
    > > in the cmd.exe the dumping took about 3 minutes and in the powershell i
    > > took about 40 minutes. I believe it is because of the out-file which
    > > does by default a conversion to unicode.
    > >
    > > So: Is there a special trick to speed-up the out-file commandlet or an
    > > other commandlet which doesnt do the conversion to unicode (because i
    > > just need the output as ascii) ?
    > >
    > > thanks in advance
    > >
    > > Korbinian
    > >

    >
    > Instead of using just a one-liner to get your job done, why dont you try out
    > the following?
    > # create the file name first.
    > $fileName = ('i:\temp\dumps\' + $objItem.Name + '.dump');
    > # create an empty ASCII file & suppress output
    > "" | out-file -Encoding ASCII | out-null
    > # now you dont have to specify encoding style.(but not sure if this will
    > speed up or not...
    > svnadmin dump $objItem.Fullname | out-file 'i:\temp\dumps\' + $objItem.Name
    > + '.dump')
    >
    >
    > I haven't tested it out but.. hmm anyways, hope you could have tried that
    > out since i am eager to know if creating a file first actually ignores
    > "encoding" process or not


    I did a quick test.
    You need to use the '-append' switch for the Out-File cmdlet, because
    otherwise you would just overwrite your previously created file.
    It should also be noted, that every file that is created this way will start
    with an empty line (0x0D, 0x0A). I don't see a direct solution for this
    because the file needs to have ASCII content for this to work. The empty line
    could be removed later on if needed.
    I think you can also leave out that "| out-null", because out-file doesn't
    seem to write something to the console.

    Anyway, I doubt that this will speed up things much.

    --
    greetings
    dreeschkind

      My System SpecsSystem Spec

  5. #5


    James Truher [MSFT] Guest

    Re: out-file very slow

    To be more specific about where the performance bottleneck is, how is the
    performance of:

    svnadmin dump $objItem.Fullname > $null


    That might help narrow in on the problem.

    jim

    --
    James W. Truher [MSFT]
    Windows PowerShell Program Management
    Microsoft Corporation
    This posting is provided "AS IS" with no warranties, and confers no rights.

    "Korbinian Stoemmer" <stoemmer@in.tum.de> wrote in message
    news:eOAEe4GlGHA.3596@TK2MSFTNGP05.phx.gbl...
    > Hi!
    >
    > I tried to dump my subversion repositories via a powershell-script.
    >
    > svnadmin dump $objItem.Fullname | out-file -encoding ASCII
    > ('i:\temp\dumps\' + $objItem.Name + '.dump')
    >
    > this line is the one that does the dump.
    > Now i noticed some major speed difference if i dumped the repositories
    > via powershel or with the old cmd.exe .
    >
    > in the cmd.exe the dumping took about 3 minutes and in the powershell i
    > took about 40 minutes. I believe it is because of the out-file which
    > does by default a conversion to unicode.
    >
    > So: Is there a special trick to speed-up the out-file commandlet or an
    > other commandlet which doesnt do the conversion to unicode (because i
    > just need the output as ascii) ?
    >
    > thanks in advance
    >
    > Korbinian




      My System SpecsSystem Spec

  6. #6


    Korbinian Stoemmer Guest

    Re: out-file very slow

    --- Original-Nachricht ---
    Absender: James Truher [MSFT]
    Datum: 23.06.2006 19:22
    > To be more specific about where the performance bottleneck is, how is the
    > performance of:
    >
    > svnadmin dump $objItem.Fullname > $null
    >
    >
    > That might help narrow in on the problem.
    >
    > jim
    >


    First: thanks to all.

    Back to the problem:

    i did some timechecks with my script:

    svnadmin dump $objItem.Fullname > $null:
    about 6 seconds for a really small repository
    svnadmin dump $objItem.Fullname | out-file -Encoding ASCII $filename;
    about 25 seconds for the same repository.
    the outputfile has a size of 2.7 Mb, so it should be no harddrive
    related problem.


    i also tried to create the file first and then dump into that file,

    # create the file name first.
    $fileName = ('i:\temp\dumps\' + $objItem.Name + '.dump');
    # create an empty ASCII file & suppress output
    "" | out-file -Encoding ASCII $filename | out-null
    # now you dont have to specify encoding style.(but not sure if this will
    speed up or not...
    svnadmin dump $objItem.Fullname | out-file $filename;

    but without setting the encoding parameter to ASCII the output in the
    file became unicode again.

    i have no idea how to speed things up!



    Thanks for the help

    Korbinian

      My System SpecsSystem Spec

out-file very slow problems?

Similar Threads
Thread Thread Starter Forum Replies Last Post
File DVD Loading Very Slow Stewart Berman Vista performance & maintenance 1 15 Dec 2008
Vista Youtube Videos Slow/Pause, File Copys Slow...etc... Billy Vista General 1 01 May 2008
Slow file copy in Vista (VERY VERY slow in fact) Nick Gilbert Vista General 4 25 Sep 2007
File shredding - slow! Mike Weller PowerShell 1 09 Apr 2007
.exe file slow to start Donaldo Vista General 5 29 Mar 2007