http://GameProgrammer.Com

Programming

GP Mailing List
     Thread Index
     Date Index

ATXGPSIG List
     Thread Index
     Date Index

Google
>

Home

Wise2Food



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Operating Systems Linux vs. Windows




----- Original Message -----
From: Mario Gonzalez <mario.gonzalez@connecta.se>
To: <gameprogrammer@gameprogrammer.com>
Sent: Monday, March 13, 2000 1:22 PM
Subject: RE: Operating Systems Linux vs. Windows


>   Hello,
>
>  Well, it is not a matter of doing things wrong, as you express it, I have
> written lightning-fast encryption algorithms too, the aim this time was to
> try to create something a bit more advanced and hopefully more secure. As
> you may imagine, this requires more calculations and more scrambling and
> key-handling. The code is written ANSI c/c++, ie no MFC or such involved,
> just to make the code as efficient as possible. The algorithm itself, is
> quite complex, it generates keytables, with 64000 elements of type long
for
> the generation of an encryption key, it generates password fingerprints
and
> so on. This is to create somewhat "secure" keys. The rest is low-level
file
> I/O and tons of bit operations. I think the code is heavy simply because
our
> algorithm includes reading and processing a  chunk of 4 chars 4 times (in
> different ways) before writing it to the output file.

Well, I must say, it sounds complicated. My algorithm is much simpler, but
still requires integer and floating-point math. But I used _inline_
functions to
accel. the inner encryption loop. But I used a trick to make it harder to
decrypt
or discover the decryption key from the encrypted file. I won't tell it to
you yet!  : )

> What I do need to do, and what I think can be done better, is to read
bigger blocks
> (for example 1024 bytes at a time) into memory for faster access, I think
this will
> improve performance. Ill send the code to you if you are interested.

You bet it will. In my first version (DOS 16-bit) the program worked like a
pipe. It read one byte from the source file, encrypted it, and spit it out
to the destination file.
Reading one byte at a time is very slow. When I ported the program to Win32,
I changed it to read 1Kb chunks, process it and write it back - much faster.
Then I tried 64 Kb, and dramatically improved the program run-time. I don't
know if
larger buffers will increase speed enough to compensate for the memory
requirements.

> As far as the Linux part is concerned, I simply think that the performance
> difference is caused by that Windows has more background threads running
> (owned by the system, of course), than Linux, giving Linux apps more
memory
> to play with.

I don't know, I'm so used to MS OSes - I do know some stuff about Linux, and
had it installed for a while - that I don't see myself using other platforms
right
now.

>
> Regards
>
> Mario Gonzalez
>

> PS. Does anyone know where to get the source for the ZIP-algorithm, or any
> other good compression algorithms? Please let me know if you do.

Try ftp://x2ftp.oulu.fi/pub/msdos/programming/compress/

Best regards

Habil Silva


>
> -----Original Message-----
> From: Habil Silva
> To: gameprogrammer@gameprogrammer.com
> Sent: 2000-03-12 13:41
> Subject: Re: Operating Systems Linux vs. Windows
>
>
> ----- Original Message -----
> From: Mario Gonzalez <mario.gonzalez@connecta.se>
> To: <gameprogrammer@gameprogrammer.com>
> Sent: Monday, February 28, 2000 3:00 PM
> Subject: RE: Operating Systems Linux vs. Windows
>
>
> > Hi!
> >
> > My opinion regarding this issue is that it is all a matter of gaining
> > experience and to learn as much as one can about the OS being used...
> >
> > At work I use NT/Win2000, but at home I use Linux. I must admit that
> in
> the
> > beginning, Linux wasn't the easiest thing to learn, but with time, I
> got a
> > certain "feel" for it, and now it is as good as any (if not better) OS
> that
> > I use, all purposes.
> >
> > From a programmer's point of view, Linux (or any UNIX-based system) is
> very
> > good for improving one's programming habits. On Linux you never get
> away
> > with being lazy, for examle if you forget to allocate memory for a
> char*,
> > you'll get runtime segmentation faults (the same code runs ok on win).
> Also,
> > Linux provides faster execution than windows. I ran my own encryption
> > program (without changing the code) on an 10mb file, first on win,
> then
> > Linux. On windows, the execution time was 3.26 mins, and on linux the
> same
> > procedure took 1.10 mins. All of this was run on the same machine
> (thank
> god
> > for dual boot), and yes, the algorithm that I use is _very_ heavy.
> >
>
> You must be doing something very wrong! I myself have designed an
> encryption
> program and it takes about 10 seconds to encrypt a 15Mb file under
> Win98,
> using an MFC application (I have a Celeron clocked at 487 MHz, and 64 Mb
> RAM).
> You say that your encryption algorithm is very heavy, but I still think
> you
> should be
> able to optimize it a lot, no matter how heavy it is. Because 3.26 mins
> is
> too
> much: a throughput of only 53 Kb/s!!
>
> > So, chances are that your programs might get faster and more efficient
> > programs on Linux, who knows, provided that you wish to learn it!
>
> In general, Linux isn't that much faster than Windows, or DOS. The DOS
> version of Quake ran about 10 fps faster under Windows 95 then under
> Linux
> (console) on a Pentium MMX 200MHz. So I don't believe that Linux runs
> much
> faster than Windows, or DOS.
>
>
> Habil Silva
>
> PS.: I don't read my mail very often, that's why I'm posting this reply
> so
> late.
>
>
>
> =================================================================
> The GameProgrammer.Com mailing list is for the open discussion
> of any topic related to the art, science, and business of
> programming games. This list is especially tolerant of beginners.
> We were all beginners once
>
> To SUBSCRIBE or UNSUBSCRIBE please visit:
> http://gameprogrammer.com/mailinglist.html
> =================================================================
> The GameProgrammer.Com mailing list is for the open discussion
> of any topic related to the art, science, and business of
> programming games. This list is especially tolerant of beginners.
> We were all beginners once
>
> To SUBSCRIBE or UNSUBSCRIBE please visit:
> http://gameprogrammer.com/mailinglist.html


=================================================================
The GameProgrammer.Com mailing list is for the open discussion
of any topic related to the art, science, and business of
programming games. This list is especially tolerant of beginners.
We were all beginners once

To SUBSCRIBE or UNSUBSCRIBE please visit:
http://gameprogrammer.com/mailinglist.html