Linked by Thom Holwerda on Sat 11th May 2013 21:41 UTC
Windows "Windows is indeed slower than other operating systems in many scenarios, and the gap is worsening." That's one way to start an insider explanation of why Windows' performance isn't up to snuff. Written by someone who actually contributes code to the Windows NT kernel, the comment on Hacker News, later deleted but reposted with permission on Marc Bevand's blog, paints a very dreary picture of the state of Windows development. The root issue? Think of how Linux is developed, and you'll know the answer.
Permalink for comment 561658
To read all comments associated with this story, please click here.
RE[17]: Too funny
by Alfman on Wed 15th May 2013 15:18 UTC in reply to "RE[16]: Too funny"
Member since:


"I guess, but in the case of a log this isn't really going to be an issue. And this also depends on whether or not reading incomplete transactions is an issue."

We seem to keep floating between two separate topics here 1) logging, and 2) implementing a generic sql database using a text engine. I think I've made clear why implementing a full SQL database over text is more trouble than it's worth. I think you've made clear that it could nevertheless work for logging since it's append only. Personally I wouldn't see the point in using a special kind of database just for logs, but I'm not denying that it could be done.

Regarding NULL DB engines:
"This would be fine. The logs are in text and you can use SQL. That fits my requirements just fine."

This would be my preferred solution.

"This is actually what I've been saying. The log should be structured in record format. CSV is a record format so that was the example I've been using (it has the added bonus of working with existing tools, but so long as the format can be read by humans I don't care.) The only additional requirement I have is that the record format should also be human readable."

This is not what I meant. For one thing, CSV's data escaping rules are non-trivial and require a state machine generate & parse CSV character by character. Very often I've seen CSV data feeds output by trivial means that don't even escape the data fields at all. Sometimes this problem is not noticed until someone enters a comma on a production machine causing fields to become misaligned. More importantly though, CSV would be a poor choice because records don't contain field metadata, the reader has to be programmed with some template to just know what each column means. This ambiguity is unacceptable when we try to insert records into the database. So XML would technically be better, but this isn't what I meant either.

I think all programs should be using a structured library interface directly without bothering with the text conversion at all. It could be a library call similar to printf, but it would have to be capable of maintaining field metadata. This call would not output text (optionally it could for interactive debugging), instead it would transmit the log record to the system logger.

You, as the administrator, could setup the system logger to take in the *structured data* and do whatever you please with it. You could output text files (whether csv, xml, yaml, json, or whatever suits your fancy), you could record the records in the database of your choosing, you could filter/throw them out without logging, you could even have special triggers to perform various actions as things are happening. This could be highly efficient as there isn't a need to convert integers to text and back again or scan text values of unknown length as is necessary with a text format.

As a programer trying to integrate subsystems, I find this far more appealing than having daemons write out text logs and then programming monitoring scripts to parse text logs back into a structural form before being able to do something useful with them. The goal would be for all programs to build on top of interfaces which enable a higher degree of data abstractions. The lowest common denominator would get raised to a datatuple instead of a line of text as it stands today.

This is getting long winded, but since it's relevant: I was actually discussing this topic with Neolander. The vision was not just for logging, but actually to replace all sorts of text I/O streams with data tupples. When I do "route -n" or "iptables -L", the programs could open a datatuple output stream instead of (or in addition to) a text output stream. Bash could be modified to support these structured data output streams and work with them.

Some examples:
iptables -L # dump human output to console.
iptables -L | spreadsheet # open tuples in spreadsheet
iptables -L | gencsv > file.csv # save tupples as csv
iptables -L | genxml > file.xml # save tupples as xml
iptables -L | genjson > file.json # ...
parsexml file.xml | genjson > file.json

iptables -L | mysqlinsert database.datatable # insert tupples into database

Note that in these examples, iptables doesn't care how the structured data gets used, and the receiving tools don't care what is producing the data. Unlike today, no parsing would be needed. This would all be possible if we could get away from text as the least common denominator and transition to data tuple based IO. (This is why I said it's best not to think in terms of "text" versus "binary", but in terms of data abstractions)

I find these ideas very inspirational and extremely compelling, but I'm not sure if there's any chance of convincing existing mainstream operating systems to change their way of doing things. If I were still working on my own OS I would certainly do it this way.

Reply Parent Score: 2