Follow Slashdot blog updates by subscribing to our blog RSS feed

 



Forgot your password?
typodupeerror
Get HideMyAss! VPN, PC Mag's Top 10 VPNs of 2016 for 55% off for a Limited Time ×

Comment Re:THIS makes it load more quickly (& safely) (Score 1) 105

Anyway: there is no reason that a DNS implementation is faster as it has the same limitations regarding disk access.

A DNS server reads zone files just once, at startup. It can do so because it has a means of getting notified of updates (rndc, zone notifies). The data is then stored in an efficient data structure that takes O(1) to find an entry (or O(k) where k is domain's length if we care about this factor, it's sharply bounded). Even without file access inefficiencies, the best a hosts file can do is O(n) (O(n*k)) -- and we can't ignore such inefficiencies, as reading and parsing a file takes ages.

(Some server implementations do O(log n) (binary tree) search rather than O(1) (hash [hopefully], trie [guaranteed]), but that's good enough to still beat a hosts file by orders of magnitude.)

Comment Re:THIS makes it load more quickly (& safely) (Score 1) 105

It's read from disk and parsed every time you resolve anything.
Which means it is in RAM ...

Yeah, page cache, but this wasn't what I'm talking about. On a modern SSD the speedup from in-RAM caching isn't that massive anymore -- and unless you mounted noatime, there's a write for every operation anyway, both to the journal and inode. And then you still need to read the file and parse it to find that entry; in the most likely case, ie, a non-blocked hostname, you'll need to parse the entire file.

while a hosts file is limited to a single hostname per entry.
Which it is actually not!

You can have multiple entries per line, like this:
0.0.0.0 facebook.com plus.google.com twatter.com goatse.cx
but a single entry applies only to a hostname, not to the entire domain below it.

Comment Re:THIS makes it load more quickly (& safely) (Score 1) 105

A hosts file is adequate if you have just a handful of addresses, but it really slows you down if you get more. It's read from disk and parsed every time you resolve anything. Linearly. You really want to run a local DNS server that stores the data in a proper data structure. A zone file can also block a whole domain while a hosts file is limited to a single hostname per entry.

Comment Re:Why don't we just make the pages smaller? (Score 2) 105

golden days when web pages were under a megabyte on average without images

I remember being told that an image should never have more than 8KB, less if it's only a minor element.

That megabyte per page becomes far less negligible when you, say, need to visit just your bank's page when abroad (over international roaming) and a single visit (several subpages, 7MB total) sets you back $100. Now think about kids in rural Africa connecting their donated OLPCs.

Comment Re:Of course not (Score 1) 149

Hows that free space looking, mudkip?

Snapshots use only as much space as the delta is. You don't rewrite all files every day (unless you mount with atime...). Obviously, old snapshots can be pruned from time to time -- but I keep monthlies forever even on small SSD, despite having backups elsewhere.

Comment Re:Of course not (Score 4, Informative) 149

Use btrfs with a daily cronjob to snapshot /, have /home on a separate subvolume (also snapshotted, but for a different reason). Anything goes wrong, you roll back / to yesterday. Want a version from two months ago? All it takes is a reboot and type subvol=sys-2016-05-18 on the grub command line. That's the key to comfortably running unstable...

Comment Re:The problem with FreeDOS... (Score 3, Insightful) 211

Practically speaking, DOS is so simple that there's not much that it could do that couldn't be easily worked around.

I'd rather say: DOS is so simple it provides nothing that can't be implemented from scratch in less time that it takes to work around its downsides.

The only worthwhile thing it gives you is a filesystem. A filesystem that doesn't work on modern machines (disks above 2GB, GPT partition tables, UEFI, sectors bigger than 512 bytes), gets corrupted on a crash, suffers from a ridiculous level of fragmentation, has bizarre limitations on file names (8.3, all caps, half of ASCII banned), and so on.

I'm not sure what's the modern equivalent of INT 13 (some EFI calls?), but otherwise, writing a simple but adequate filesystem without those flaws is something any half-decent programmer can do in less than a day. Writing filesystems is like writing a compiler: a good optimized one takes a team a decade, something that works can be done really quickly.

I've done so myself (filesystem-in-a-file rather than filesystem-on-sectors, though), with crash resiliency, transactions and zlib compression, although with some other limitations that fit my particular use case. And if you don't want to reinvent the wheel, there should be plenty of code to reuse around.

Comment Re: Use it via DOSEMU (Score 1) 211

edit.exe is for spoiled kids. Real {M,Wom}en(TM) used edlin.com!

Well, strictly speaking I hardly ever used edlin, and ed's source code is pretty much "while read x;do echo ?;done", but on a MUD I've coded for over a decade, you could either muck around with FTP (not compatible with any fuse stuff) or use ed. As their ed was vastly improved over both edlin and Unix ed, it was pretty comfortable once you got used to it.

Comment Re:Well, I _wanted_ to like her. (Score 1) 175

and says that nuclear energy is, "dirty, dangerous and expensive, and should be precluded on all of those counts", when the actual data shows just the opposite.

If you take into account all of the government subsidies, including covering the industry's uninsurable risks, I'm not sure whether at least the cost argument holds.

You forgot that it's the only form of energy that's currently regulated to include all of externalities in its cost. For a fair comparison, you'd need to require coal to catch everything (CO2, sulphur, other toxins, more radioactive isotopes than a nuclear plant, etc) from all chimneys, transport and store that securely for hundreds of years. And despite that, nuclear is still competitive and causes many orders of magnitude less deaths.

Slashdot Top Deals

"Summit meetings tend to be like panda matings. The expectations are always high, and the results usually disappointing." -- Robert Orben

Working...