🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.c.moderated
Article #2404

Efficiency Question : bits vs. bytes (or anything else, for that matter)

#2404
From: Asmodeus
Date: Wed, 27 Mar 1996 12:33
17 lines
1002 bytes
I have set up an array in the following manner (obviously I just need
0 or 1) :

typedef struct my_bits {
	unsigned the_bit : 1;
};

my_bits the_array[800][800];

	My question is this : I have read that some operations ( =,+,- are
what I use) are slower when performed on bits as opposed to other
types.  My objective is to optimize the code for speed, and I figured
using less memory would help me do so, now I'm having doubts.  So what
is more efficient, bits or some other type???

				Thanks in advance for your help.
Technical Details
Message-ID: <4jbciv$2kk@solutions.solon.com>
Path: arc1-ca.pugleaf.net!solon.com!not-for-mail

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!solon.com!not-for-mail
From: vjarnot@mnw.net (Asmodeus)
Newsgroups: comp.lang.c.moderated
Subject: Efficiency Question : bits vs. bytes (or anything else, for that matter)
Date: 27 Mar 1996 06:33:35 -0600
Organization: Never!!!
Sender: clc@solutions.solon.com
Approved: clc@solutions.solon.com
Message-ID: <4jbciv$2kk@solutions.solon.com>
Reply-To: vjarnot@mnw.net
NNTP-Posting-Host: solutions.solon.com
X-Newsreader: Forte Free Agent 1.0.82