linux text/ini files faster than windows?

Discussion in 'NZ Computing' started by frederick, Jun 9, 2004.

  1. frederick

    frederick Guest

    Since I tested speed of writing to the registry versus ini files in WinXP using
    delphi, why not do the same by using Kylix to compile exactly the same Pascal
    code to write to the ini file, and then run it on exactly the same machine?

    Result:

    Windows XP to write 10,000 times to an ini file was:
    11.04 seconds

    Linux (2.4 kernel) to write 10,000 times to an ini file was:
    1.88 seconds !

    Linux was almost 6 times faster than Windows XP to do exactly the same thing :)
    -but also about 13 times slower than using the windows registry :-(
    frederick, Jun 9, 2004
    #1
    1. Advertising

  2. In <> frederick wrote:
    > Since I tested speed of writing to the registry versus ini files in
    > WinXP using delphi, why not do the same by using Kylix to compile
    > exactly the same Pascal code to write to the ini file, and then run it
    > on exactly the same machine?
    >
    > Result:
    >
    > Windows XP to write 10,000 times to an ini file was:
    > 11.04 seconds
    >
    > Linux (2.4 kernel) to write 10,000 times to an ini file was:
    > 1.88 seconds !
    >
    > Linux was almost 6 times faster than Windows XP to do exactly the same
    > thing :) -but also about 13 times slower than using the windows
    > registry :-(


    Yeah, but now add 6 hours to reinstall Windows plus all your
    applications when the registry hoses itself. It happened to me once with
    a Windows 95 PC. The backup registry was also damaged, and I spent some
    time trying to work out how to recover it and finally gave up. On a Mac
    I can just delete the entire preferences folder and all the apps will
    recreate their preference files when first started. Actually, I did come
    across a Mac program once which wouldn't do this and had to be
    reinstalled, and what do you know? It's preference file was called
    something like APPNAME.INI. Yep, it was a Windows port :eek:P


    --
    Roger Johnstone, Invercargill, New Zealand
    http://vintageware.orcon.net.nz/
    ________________________________________________________________________
    No Silicon Heaven? Preposterous! Where would all the calculators go?

    Kryten, from the Red Dwarf episode "The Last Day"
    Roger Johnstone, Jun 9, 2004
    #2
    1. Advertising

  3. frederick

    Ron McNulty Guest

    Maybe so. Try another benchmark. There is a Delphi demo that compares three
    different sort algorithms. Last time I tried it on Kylix/Red hat it ran 90
    times (yes, not percent) slower on Linux.

    That was a while ago. Maybe the task switching of Linux has improved since?

    Regards

    Ron

    "frederick" <> wrote in message
    news:...
    > Since I tested speed of writing to the registry versus ini files in WinXP

    using
    > delphi, why not do the same by using Kylix to compile exactly the same

    Pascal
    > code to write to the ini file, and then run it on exactly the same

    machine?
    >
    > Result:
    >
    > Windows XP to write 10,000 times to an ini file was:
    > 11.04 seconds
    >
    > Linux (2.4 kernel) to write 10,000 times to an ini file was:
    > 1.88 seconds !
    >
    > Linux was almost 6 times faster than Windows XP to do exactly the same

    thing :)
    > -but also about 13 times slower than using the windows registry :-(
    >
    >
    Ron McNulty, Jun 9, 2004
    #3
  4. frederick

    steve Guest

    Roger Johnstone wrote:
    > In <> frederick wrote:
    >
    >>Since I tested speed of writing to the registry versus ini files in
    >>WinXP using delphi, why not do the same by using Kylix to compile
    >>exactly the same Pascal code to write to the ini file, and then run it
    >>on exactly the same machine?
    >>
    >>Result:
    >>
    >>Windows XP to write 10,000 times to an ini file was:
    >>11.04 seconds
    >>
    >>Linux (2.4 kernel) to write 10,000 times to an ini file was:
    >>1.88 seconds !
    >>
    >>Linux was almost 6 times faster than Windows XP to do exactly the same
    >>thing :) -but also about 13 times slower than using the windows
    >>registry :-(


    Isn't some or all of the registry held in memory?

    > Yeah, but now add 6 hours to reinstall Windows plus all your
    > applications when the registry hoses itself.


    Agreed!

    Linux is much easier to recover. You can also copy an existing Linux
    system over top of a VERY basic install on a new hard drive...and
    effectively have migrated the entire system. Much easier than Windows XP.
    steve, Jun 9, 2004
    #4
  5. frederick

    steve Guest

    Ron McNulty wrote:
    > Maybe so. Try another benchmark. There is a Delphi demo that compares three
    > different sort algorithms. Last time I tried it on Kylix/Red hat it ran 90
    > times (yes, not percent) slower on Linux.
    >
    > That was a while ago. Maybe the task switching of Linux has improved since?
    >
    > Regards
    >
    > Ron


    So Kylix is slower than Delphi?

    ......and? :)
    steve, Jun 9, 2004
    #5
  6. frederick

    Steve Guest

    Ron McNulty wrote:
    > Maybe so. Try another benchmark. There is a Delphi demo that compares three
    > different sort algorithms. Last time I tried it on Kylix/Red hat it ran 90
    > times (yes, not percent) slower on Linux.
    >
    > That was a while ago. Maybe the task switching of Linux has improved since?
    >
    > Regards
    >
    > Ron
    >
    > "frederick" <> wrote in message
    > news:...
    >
    >>Since I tested speed of writing to the registry versus ini files in WinXP

    >
    > using
    >
    >>delphi, why not do the same by using Kylix to compile exactly the same

    >
    > Pascal
    >
    >>code to write to the ini file, and then run it on exactly the same

    >
    > machine?
    >
    >>Result:
    >>
    >>Windows XP to write 10,000 times to an ini file was:
    >>11.04 seconds
    >>
    >>Linux (2.4 kernel) to write 10,000 times to an ini file was:
    >>1.88 seconds !
    >>
    >>Linux was almost 6 times faster than Windows XP to do exactly the same

    >
    > thing :)
    >
    >>-but also about 13 times slower than using the windows registry :-(
    >>
    >>

    >
    >
    >

    .... task switching on Windoze? You've just got to be joking! Anyway, why
    would a single sort algorithm require any switching at all? I assume
    you're talking about single cpu machines, so there's nothing to be
    gained with multithreading.

    Why not use a language that's performance orientated, rather than
    delphi. Maybe the results will be useful then.

    I reckon you've been believing Gartner reports again.

    Steve
    Steve, Jun 9, 2004
    #6
  7. In article <>,
    says...
    > Since I tested speed of writing to the registry versus ini files in WinXP using
    > delphi, why not do the same by using Kylix to compile exactly the same Pascal
    > code to write to the ini file, and then run it on exactly the same machine?
    >
    > Result:
    >
    > Windows XP to write 10,000 times to an ini file was:
    > 11.04 seconds
    >
    > Linux (2.4 kernel) to write 10,000 times to an ini file was:
    > 1.88 seconds !
    >
    > Linux was almost 6 times faster than Windows XP to do exactly the same thing :)
    > -but also about 13 times slower than using the windows registry :-(


    XP officially DOES NOT SUPPORT ini files. The code is probably some old
    16 bit code for backward compatibility.
    Patrick Dunford, Jun 9, 2004
    #7
  8. frederick

    frederick Guest

    "Patrick Dunford" <> wrote in message
    news:...
    > In article <>,
    > says...
    > > Since I tested speed of writing to the registry versus ini files in WinXP

    using
    > > delphi, why not do the same by using Kylix to compile exactly the same

    Pascal
    > > code to write to the ini file, and then run it on exactly the same machine?
    > >
    > > Result:
    > >
    > > Windows XP to write 10,000 times to an ini file was:
    > > 11.04 seconds
    > >
    > > Linux (2.4 kernel) to write 10,000 times to an ini file was:
    > > 1.88 seconds !
    > >
    > > Linux was almost 6 times faster than Windows XP to do exactly the same thing

    :)
    > > -but also about 13 times slower than using the windows registry :-(

    >
    > XP officially DOES NOT SUPPORT ini files. The code is probably some old
    > 16 bit code for backward compatibility.


    ahem... excuse me...
    isn't there at least one important ini file in the root directory of the
    primary partition of a multi boot XP machine that is so mission critical that
    the
    machine won't boot without it being present and correct?
    :)
    frederick, Jun 9, 2004
    #8
  9. frederick

    AD. Guest

    On Thu, 10 Jun 2004 09:11:07 +1200, frederick wrote:

    >> XP officially DOES NOT SUPPORT ini files. The code is probably some old
    >> 16 bit code for backward compatibility.

    >
    > ahem... excuse me...
    > isn't there at least one important ini file in the root directory of the
    > primary partition of a multi boot XP machine that is so mission critical
    > that the
    > machine won't boot without it being present and correct?
    > :)


    LOL well spotted :)

    It's not just multi boot machines either, they all need it.

    Cheers
    Anton
    AD., Jun 9, 2004
    #9
  10. In article <>,
    says...
    >
    > "Patrick Dunford" <> wrote in message
    > news:...
    > > In article <>,
    > > says...
    > > > Since I tested speed of writing to the registry versus ini files in WinXP

    > using
    > > > delphi, why not do the same by using Kylix to compile exactly the same

    > Pascal
    > > > code to write to the ini file, and then run it on exactly the same machine?
    > > >
    > > > Result:
    > > >
    > > > Windows XP to write 10,000 times to an ini file was:
    > > > 11.04 seconds
    > > >
    > > > Linux (2.4 kernel) to write 10,000 times to an ini file was:
    > > > 1.88 seconds !
    > > >
    > > > Linux was almost 6 times faster than Windows XP to do exactly the same thing

    > :)
    > > > -but also about 13 times slower than using the windows registry :-(

    > >
    > > XP officially DOES NOT SUPPORT ini files. The code is probably some old
    > > 16 bit code for backward compatibility.

    >
    > ahem... excuse me...
    > isn't there at least one important ini file in the root directory of the
    > primary partition of a multi boot XP machine that is so mission critical that
    > the
    > machine won't boot without it being present and correct?
    > :)


    That may well be. But if you read the API specs, INI files are legacy
    code.

    There are APIs to convert INIs to the registry automatically.
    Patrick Dunford, Jun 9, 2004
    #10
  11. frederick

    Ron McNulty Guest

    The demo is to show the different speeds of three sort algorithms. Each runs
    in its own thread. To update the screen, Delphi (or Kylix) needs to switch
    to the GUI thread (as does any GUI system I am familiar with). This is a
    light-weight thread switch on Windows, but a full process switch on Linux
    (Linux does not have lightweight threads yet). If you comment out the thread
    switching, speed on both platforms is similar. Sure, the demo is contrived,
    but I quoted it to show that benchmarks can prove almost anything.

    > Why not use a language that's performance orientated, rather than
    > delphi. Maybe the results will be useful then.

    Got me there - do you suggest Assembler, C or C++(maybe)? Delphi is
    certainly a hell of a lot faster than Java or VB and I think would beat .NET
    as well (I've not tested that).

    "Steve" <> wrote in message
    news:ca6q6i$2es$...
    > Ron McNulty wrote:
    > > Maybe so. Try another benchmark. There is a Delphi demo that compares

    three
    > > different sort algorithms. Last time I tried it on Kylix/Red hat it ran

    90
    > > times (yes, not percent) slower on Linux.
    > >
    > > That was a while ago. Maybe the task switching of Linux has improved

    since?
    > >
    > > Regards
    > >
    > > Ron
    > >
    > > "frederick" <> wrote in message
    > > news:...
    > >
    > >>Since I tested speed of writing to the registry versus ini files in

    WinXP
    > >
    > > using
    > >
    > >>delphi, why not do the same by using Kylix to compile exactly the same

    > >
    > > Pascal
    > >
    > >>code to write to the ini file, and then run it on exactly the same

    > >
    > > machine?
    > >
    > >>Result:
    > >>
    > >>Windows XP to write 10,000 times to an ini file was:
    > >>11.04 seconds
    > >>
    > >>Linux (2.4 kernel) to write 10,000 times to an ini file was:
    > >>1.88 seconds !
    > >>
    > >>Linux was almost 6 times faster than Windows XP to do exactly the same

    > >
    > > thing :)
    > >
    > >>-but also about 13 times slower than using the windows registry :-(
    > >>
    > >>

    > >
    > >
    > >

    > ... task switching on Windoze? You've just got to be joking! Anyway, why
    > would a single sort algorithm require any switching at all? I assume
    > you're talking about single cpu machines, so there's nothing to be
    > gained with multithreading.
    >
    > Why not use a language that's performance orientated, rather than
    > delphi. Maybe the results will be useful then.
    >
    > I reckon you've been believing Gartner reports again.
    >
    > Steve
    Ron McNulty, Jun 10, 2004
    #11
  12. frederick

    Barg Guest

    > That may well be. But if you read the API specs, INI files are legacy
    > code.


    You mean M$ aren't following their own standards?
    Barg, Jun 10, 2004
    #12
  13. frederick

    Divine Guest

    On Thu, 10 Jun 2004 18:17:46 +1200, Barg wrote:

    > You mean M$ aren't following their own standards?


    Now why are we not surprised???


    Divine

    --
    The Queen's Mother: "Well I don't know what all you queens are doing,
    but this old Queen wants a drink."
    Divine, Jun 10, 2004
    #13
  14. frederick

    Steven H Guest

    On Wed, 9 Jun 2004 19:42:42 +1200, frederick wrote:

    > Since I tested speed of writing to the registry versus ini files in WinXP using
    > delphi, why not do the same by using Kylix to compile exactly the same Pascal
    > code to write to the ini file, and then run it on exactly the same machine?
    >
    > Result:
    >
    > Windows XP to write 10,000 times to an ini file was:
    > 11.04 seconds
    >
    > Linux (2.4 kernel) to write 10,000 times to an ini file was:
    > 1.88 seconds !
    >
    > Linux was almost 6 times faster than Windows XP to do exactly the same thing :)
    > -but also about 13 times slower than using the windows registry :-(


    hmmm - lets check msdn for the calls that manipulate ini files

    GetPrivateProfileString & WritePrivateProfileString (there are others)

    for GetPrivateProfileString MSDN says

    The GetPrivateProfileString function retrieves a string from the specified
    section in an initialization file.

    Note This function is provided only for compatibility with 16-bit
    Windows-based applications. Applications should store initialization
    information in the registry.

    ohhh so its 16bit???

    your complaining about 16 BIT API's running slow as shit on a 32bit
    operating system..

    all 16bit calls MUST go through a thunk in order to make them work.

    **** sake, i didnt realise linux had GetPrivateProfileString &
    WritePrivateProfileString - how about you get a clue and compare apples
    with apples.

    here is some measurements for some simple file io, all it does is open up a
    stream writer and dump 10,000 things of shit into a file.

    perfFreq = 3579545, overheadTicks = 111, overheadMs = 0.0111
    Duration MS - 57.2417

    thats jus over half a second in a debug compile

    perfFreq = 3579545, overheadTicks = 115, overheadMs = 0.0115
    Duration MS - 39.2243

    a little bit quicker in a release compile

    time includes single allocation & deallocation of stream object
    --
    -------------------------------------------
    Steven H, 3rd Year B.I.T. Otago Polytechnic

    ..net Geek
    Steven H, Jun 11, 2004
    #14
  15. In article <m2Txc.1743$>,
    says...
    > > That may well be. But if you read the API specs, INI files are legacy
    > > code.

    >
    > You mean M$ aren't following their own standards?


    I mean, pure and simple, all INI code is legacy code, so it is not being
    maintained or updated.
    Patrick Dunford, Jun 11, 2004
    #15
  16. frederick

    Gavin Tunney Guest

    On 9 Jun 2004 09:27:00 GMT, Roger Johnstone <>
    wrote:

    >In <> frederick wrote:
    >> Since I tested speed of writing to the registry versus ini files in
    >> WinXP using delphi, why not do the same by using Kylix to compile
    >> exactly the same Pascal code to write to the ini file, and then run it
    >> on exactly the same machine?
    >>
    >> Result:
    >>
    >> Windows XP to write 10,000 times to an ini file was:
    >> 11.04 seconds
    >>
    >> Linux (2.4 kernel) to write 10,000 times to an ini file was:
    >> 1.88 seconds !
    >>
    >> Linux was almost 6 times faster than Windows XP to do exactly the same
    >> thing :) -but also about 13 times slower than using the windows
    >> registry :-(

    >
    >Yeah, but now add 6 hours to reinstall Windows plus all your
    >applications when the registry hoses itself. It happened to me once with
    >a Windows 95 PC. The backup registry was also damaged, and I spent some
    >time trying to work out how to recover it and finally gave up. On a Mac
    >I can just delete the entire preferences folder and all the apps will
    >recreate their preference files when first started. Actually, I did come
    >across a Mac program once which wouldn't do this and had to be
    >reinstalled, and what do you know? It's preference file was called
    >something like APPNAME.INI. Yep, it was a Windows port :eek:P


    The registry is a bit of a problem, but the point is that it's a known
    problem. Like all operating systems you learn the issues & you deal
    with them, in the case of Windows 95 that included making registry
    backups.

    When I was supporting win 95 machines I wrote my own utility for
    backing up & restoring the registry, because I knew it was necessary.
    Over half the problems I encountered with win95 machines were fixed
    by restoring a backup, I very rarely had to reinstall Windows.

    When Win98 came out some 40% of Windows problems I came across could
    be fixed with the simple expedient of scanreg /restore. If MS hadn't
    made such a monumental cockup of the scanreg restore utility I could
    have fixed a lot of Windows faults with a 10minute phone call.

    It all comes down to learning how to use your operating system, and in
    that regard Windows is no different to any other OS... they've all got
    their little quirks & bugs.

    Btw I don't see anything wrong with the registry concept, it's just
    MSs implementation of it that's a bit problematic. MS never seem to
    finish anything, they're always more interested in designing new
    tricks than they are fine-tuning existing code. The registry is a case
    in point there, it works but has room for improvement.

    Cheers

    Gavin
    Gavin Tunney, Jun 12, 2004
    #16
  17. Suddenly, Roger Johnstone sprang forth and uttered these pithy words:
    > It happened to me once with
    > a Windows 95 PC. The backup registry was also damaged, and I spent some
    > time trying to work out how to recover it and finally gave up.


    Well, that sure proves that Windows NT, 2000, and XP have an unreliable
    registry.

    Fact is, any file can get hosed. The registry is stored in only a few
    files, but has an internal allocation system much like a file system...
    so whats the difference really
    --
    aaronl at consultant dot com
    For every expert, there is an equal and
    opposite expert. - Arthur C. Clarke
    Aaron Lawrence, Jun 12, 2004
    #17
  18. Suddenly, Patrick Dunford sprang forth and uttered these pithy words:
    > I mean, pure and simple, all INI code is legacy code, so it is not being
    > maintained or updated.


    But it works perfectly well and is probably very simple. So what's the
    problem? Probably 50% of "Windows" is stuff like this. I'm sure
    Microsoft only work actively on a small percentage of their APIs at any
    particular time.
    --
    aaronl at consultant dot com
    For every expert, there is an equal and
    opposite expert. - Arthur C. Clarke
    Aaron Lawrence, Jun 12, 2004
    #18
  19. In article <>,
    says...
    > On 9 Jun 2004 09:27:00 GMT, Roger Johnstone <>
    > wrote:
    >
    > >In <> frederick wrote:
    > >> Since I tested speed of writing to the registry versus ini files in
    > >> WinXP using delphi, why not do the same by using Kylix to compile
    > >> exactly the same Pascal code to write to the ini file, and then run it
    > >> on exactly the same machine?
    > >>
    > >> Result:
    > >>
    > >> Windows XP to write 10,000 times to an ini file was:
    > >> 11.04 seconds
    > >>
    > >> Linux (2.4 kernel) to write 10,000 times to an ini file was:
    > >> 1.88 seconds !
    > >>
    > >> Linux was almost 6 times faster than Windows XP to do exactly the same
    > >> thing :) -but also about 13 times slower than using the windows
    > >> registry :-(

    > >
    > >Yeah, but now add 6 hours to reinstall Windows plus all your
    > >applications when the registry hoses itself. It happened to me once with
    > >a Windows 95 PC. The backup registry was also damaged, and I spent some
    > >time trying to work out how to recover it and finally gave up. On a Mac
    > >I can just delete the entire preferences folder and all the apps will
    > >recreate their preference files when first started. Actually, I did come
    > >across a Mac program once which wouldn't do this and had to be
    > >reinstalled, and what do you know? It's preference file was called
    > >something like APPNAME.INI. Yep, it was a Windows port :eek:P

    >
    > The registry is a bit of a problem, but the point is that it's a known
    > problem. Like all operating systems you learn the issues & you deal
    > with them, in the case of Windows 95 that included making registry
    > backups.
    >
    > When I was supporting win 95 machines I wrote my own utility for
    > backing up & restoring the registry, because I knew it was necessary.
    > Over half the problems I encountered with win95 machines were fixed
    > by restoring a backup, I very rarely had to reinstall Windows.
    >
    > When Win98 came out some 40% of Windows problems I came across could
    > be fixed with the simple expedient of scanreg /restore. If MS hadn't
    > made such a monumental cockup of the scanreg restore utility I could
    > have fixed a lot of Windows faults with a 10minute phone call.
    >
    > It all comes down to learning how to use your operating system, and in
    > that regard Windows is no different to any other OS... they've all got
    > their little quirks & bugs.
    >
    > Btw I don't see anything wrong with the registry concept, it's just
    > MSs implementation of it that's a bit problematic. MS never seem to
    > finish anything, they're always more interested in designing new
    > tricks than they are fine-tuning existing code. The registry is a case
    > in point there, it works but has room for improvement.


    The registry conceptually is very good. You see people defending this
    model of endless ini and cfg files, which is how Linux does it. It is a
    huge effort to keep track of all the different config files in a Linux
    type of system. Since Windows 3.1 the Sysedit utility helps you to keep
    track of Win9x's various config files (config.sys, autoexec.bat, win.ini,
    system.ini, protoco.ini etc)
    Patrick Dunford, Jun 12, 2004
    #19
  20. frederick

    frederick Guest

    "Aaron Lawrence" <> wrote in message
    news:...
    > Suddenly, Patrick Dunford sprang forth and uttered these pithy words:
    > > I mean, pure and simple, all INI code is legacy code, so it is not being
    > > maintained or updated.

    >
    > But it works perfectly well and is probably very simple. So what's the
    > problem? Probably 50% of "Windows" is stuff like this. I'm sure
    > Microsoft only work actively on a small percentage of their APIs at any
    > particular time.
    > --

    The windows inifile api is 16 bit legacy code, and "longhorn" will offer no 16
    bit support, so what happens with any application that uses the api to
    read/write ini files? That is still a lot of applications, including a lot of
    MS's own until recently.
    frederick, Jun 12, 2004
    #20
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. lkeikoomion
    Replies:
    2
    Views:
    485
    Hugh Candlin
    Apr 21, 2004
  2. lkeikoomion
    Replies:
    2
    Views:
    589
    Hugh Candlin
    Apr 21, 2004
  3. Replies:
    15
    Views:
    890
  4. Ian

    Windows XP SP3 faster than Vista SP1?

    Ian, Nov 26, 2007, in forum: Front Page News
    Replies:
    0
    Views:
    830
  5. Bruce Sinclair

    registry vs ini text files

    Bruce Sinclair, Jun 9, 2004, in forum: NZ Computing
    Replies:
    18
    Views:
    967
    Patrick Dunford
    Jun 11, 2004
Loading...

Share This Page