A Dyson sphere, capturing all light that comes out of a star, is only useful if you're relying on a star to produce your energy. At some point (probably pretty early), we'll learn to do fusion or even direct matter to energy conversion in a controlled fashion. Then you don't want a central star, the energy will be produced within the habitat itself. This is usually called a Jupiter brain, but it doesn't have to be lighter than a star, it can be much heavier.

At that point the goal is to maximize matter density, especially
locally (for more efficient communication), and radiating waste
heat. Communication costs increase linearly with distance. One
example of a large data problem is sorting, which requires 1 query
across everything, 2 to the nearest 1/2, 3 to the nearest 1/4, and n
to the nearest 2^{-n} of all nodes. For sorting, local
density is much more important than long range density, but long
range density still matters.

A sort of torus works again. But instead of a huge thin torus surrounding the star, where the diameter of the tube is 1/3 the diameter of the whole torus, you'd want a bigger hole in the middle so there's less stretching during the orbit, so matter can be packed closer together. Something like the tube being 1/6 the diameter of the whole torus. You'd have 15km radius spinning spheres of matter, or whatever your chunk size is that gives you a tolerable gravity and pressure, dense packed about a radius apart, throughout the torus. They'd be wired together through the poles, so you can pull on wires for stationkeeping. This gives you mass filling pi/12sqrt(2) = 1/5.4 of the space within the tube. Something like that; it isn't really dense packing because there's a lot of skew during the orbit. The hole through the middle of the torus is big, 2x the diameter of the tube, but the smaller you make the hole, the further apart you need the spheres to account for skew during the orbit.

For a single sphere, if you spin it, the spinning can cancel the force of gravity towards the axis. That only leaves the force of gravity along the axis. The spheres are going to be full of computation, so they have to radiate heat. And they have to withstand their own gravity. I ignored heat, and assumed withstanding gravity should be similar to the strength of a 20-story office building, ran some calculations that I didn't doublecheck, and got a 15km radius. You want the sphere as big as possible because that's how big a set of data you can have maximally close by.

Such a torus, if it's the mass of the sun and the spheres are density 1, will be 1.25 million kilometers in radius, from the center to the outside of the tube. That's 3x the radius of the sun. One 100x the mass of the sun would be 15x the radius of the sun. All the mass in it would experience microgravity, regardless of the size.

Upshot: you can put as much mass as you want pretty close together, in a stable configuration, so that nearly all the mass is in vacuum, microgravity, and low pressure. Radiating heat is going to be the limiting factor on habitat design once we can generate our own energy rather than relying on starlight.