cellio: (embla)
Monica ([personal profile] cellio) wrote2003-07-08 05:02 pm
Entry tags:

short takes during a long build

Java compilations are much, much faster than C++ ones were. I must remember this when I get impatient.

One lane of the Boulevard of the Allies has been closed for a couple weeks due to construction. It's only closed for a block, and generally it doesn't hinder traffic flow. Today, however, traffic was crawling there, and I have no idea why. What, did last night's spectacular storm cause drivers to be afraid of puddles or something? Sheesh.

The storm was quite loud and bright last night. I think I jolted awake from proximate thunderclaps at least three times. This made the cats who were sleeping on/near me unhappy, but it wasn't exactly under my control. This morning it seemed to have cooled things down and sucked some of the humidity out of the air, though the effect apparently didn't last. (I haven't been out since morning.)

Sharon and Elliott have a new cat. It's shaped like a Siamese, but it's all white. Elliott told me that because it has green eyes it is an "Oriental Shorthair"; if, instead, it had blue eyes, it would be an "Unpointed Siamese". Eye color is a defining characteristic of the breed but pointing is not? I didn't know that.

hmmm

[identity profile] alfiechat.livejournal.com 2003-07-08 05:51 pm (UTC)(link)
Our cats are oriental shorthairs, Monica. not sure about the green eyes, though. Is their cat a purebred?> ours are.
goljerp: Photo of the moon Callisto (Default)

[personal profile] goljerp 2003-07-09 07:50 am (UTC)(link)
Java compilations are much, much faster than C++ ones were.

Also, Moore's law is helpful, because those processors just keep getting faster and faster... :-)
jducoeur: (Default)

[personal profile] jducoeur 2003-07-09 04:55 pm (UTC)(link)
Are you doing from-scratch recompilations, or incremental? The bane of C++ is incremental changes. Whereas changing one line in Java usually only forces the recompilation of at most a small number of files, changing a line in a C++ header file can force huge cascades of unreasonable recompilation. That's what's usually at fault when C++ is being a pain in the ass.

(You can avoid it, but it takes a lot of discipline. The guy I learned C++ from was religious about keeping dependencies low in order to keep recompiles fast. The result is usually a much cleaner code base -- that discipline has other nice side-effects -- but you have to build it into the architecture from the beginning...)

If you're doing from-scratch, that's kind of odd. C++ compiles are slower than Java (since you've got a much more complex back end involved, producing optimized native code instead of simple bytecode), but it shouldn't be a factor of ten difference...
jducoeur: (Default)

[personal profile] jducoeur 2003-07-10 05:35 pm (UTC)(link)
Makefiles usually aren't the culprit with C++. The problem is that files largely relate to each other through lexical inclusion, and there's a very strong tendency for headers to include other headers. So changing *anything* in a header file (which in an ordinary C++ project is necessary for even the average small change) causes several files to rebuild, and a file that's nested can cause whole libraries to rebuild.

Worse, the way linkage works in C++, it's very easy to wind up with obscene link dependencies, so that changing a class in one library forces the entire universe to relink. On a big project, that can be even worse than the recompiles.

The way you avoid this is by rigorous interface/implementation separation. You divide the project down into sensible libraries, and with a few exceptions you allow these libraries to *only* speak to each other through interfaces. The result is that you get neither recompile problem -- interface headers usually don't nest like concrete class ones do, and if properly written they don't introduce link dependencies.

The problem, though, is that you have to introduce that discipline when you're designing the project, and be absolutely religious about it from them on. It's worth doing (like I said, it usually results in far cleaner code as a side-effect), but most folks aren't willing to go to the effort...

(Yes, I'm an engineering design nerd...)