Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

How much do comments slow down the compiler?

Name: Anonymous 2015-02-21 7:26

Is it really worth it to force the compiler to have to sort out which statements to skip and which to attend to? Seems like a non-zero slice of time is being wasted by the lexer just to make shit easier for the programmer.

Name: Anonymous 2015-02-21 7:34

It is non-zero but in practise, it's negligible and easy to ignore. Try stripping out the comments in the GCC source code and then measure the time it takes to compile GCC.

Name: Anonymous 2015-02-21 7:43

>>2
practise
YOU'RE DOING IT ON PURPOSE NOW YOU FUCKING FAGGOT

Name: Anonymous 2015-02-21 7:51

>>3
Calm down. You're killing my good vibrations.

Name: Anonymous 2015-02-21 8:17

wow OP you're a fuckin idiot. the compiler can't see comments at all so it cant possibly slow it down.. reatrd..

Name: Anonymous 2015-02-21 8:31

>>5
So they magically disappear into the ether before the lexer even has a chance to lex them? You are such a retard.

Name: Anonymous 2015-02-21 9:03

>>3
I'm not sorry that I cannot take such rude people seriously. I will entertain any reasonable request for reasonable people. Sir, I bid you good day.

Name: Anonymous 2015-02-21 9:26

Comments are stripped before everything else is parsed
thttp://en.wikichip.org/wiki/c/phases_of_translation#Translation_phases

Name: Anonymous 2015-02-21 9:44

>>1
According to my measurements, gcc can compile on the order of half a gigabyte of comments per second.

Suppose I type comments at 50 wpm, stream of consciousness style, eight hours per day, without holidays, I can produce about 50 megabytes of comments per year. So in about 10 years the time gcc spends compiling my comments would become noticeable, and in a hundred years, as I'm breaking the 5 gigabytes of comments mark, that 10 second delay would become somewhat annoying even.

Thank you for bringing this to my attention, OP. I will give the concern you raised due consideration, and might even adjust my commenting habits.

Name: Anonymous 2015-02-21 9:59

>>8
I said "lexed" not "parsed". In order to strip them, you have to first lex them. That is where the (negligible) slowdown comes from. Understood?

Name: Anonymous 2015-02-21 10:11

COMMENTS DONT EXIST AT COMPILER TIME YOU FUCKIN IDIOTS

THEY GET ERASED

THEY DISAPPEAR

THATS WHY THEY ARE COMMENTS

THATS WHY YOU CAN PUT ANYTHING IN THEM

HOW FUCKING DIFFICULT IS THAT TO UNDERSTNAD YOU NIGGER RETARD SHITBAG FUCKWITS

Name: Anonymous 2015-02-21 10:29

>>11
Comments exist at the lexing phase. Lexer is a part of the compiler.

HOW FUCKING DIFFICULT IS THAT TO UNDERSTNAD YOU NIGGER RETARD SHITBAG FUCKWIT?

Name: Anonymous 2015-02-21 11:15

>>12
See >>8 comments are stripped out via simple replacement, there is no lexer involved. If C used nested comments, this could be useful.

Name: Anonymous 2015-02-21 12:35

THATS WHY THEY ARE COMMENTS

THATS WHY YOU CAN PUT ANYTHING IN THEM

OK if you are so clever, put a newline followed by the n-word in a usual "//" comment. I'll be waiting.

Name: Anonymous 2015-02-21 12:55

// nigger
// stole my wallet


challenge accepted!!

Name: Anonymous 2015-02-21 13:22

>>13
C standard

Nobody cares about your primitive caveman bytefuck languages where you can't even use things before defining them.

Besides, you haven't even read what is linked in >>8, otherwise you would have concurred that I'm right:

Tokenization

In the third phase of translation, the preprocessor tokenizes the source file into preprocessing tokens and sequences of whitespace characters. Comments are placed by a single whitespace character

Tokenization is another word for lexing (do I need to explain that more or can you follow at least this far?). Thus, comments are stripped out only at the lexing phase. Which is a part of compilation (because without lexing there would be no parsing and thus the compiler wouldn't "see" any actual code - do I need to explain that more, or is your pea-brain powerful enough to understand English?

Name: Anonymous 2015-02-21 14:10

Nobody cares about your primitive caveman bytefuck languages
saving microseconds wasted by comment tokenization

Name: Anonymous 2015-02-21 15:06

>>17
Whom are you quoting in the second quote?

Name: Anonymous 2015-02-21 16:14

>>17
Its a sarcastic reference to the thread.

Name: Anonymous 2015-02-21 16:15

>>18
*whom quotest thou in the second quote?

Name: Anonymous 2015-02-21 16:17

>>17
Almost a song;
Nobody cares about
Your primitive caveman bytefuck languages
Saving microseconds
Wasted by comment tokenization

Name: Anonymous 2015-02-21 18:13

check' em

Name: Anonymous 2015-02-21 21:41

None-dubs-related posts slow down the checking of the dubs.

Name: Anonymous 2015-02-21 21:45

Sometimes I type in the address of the old world4ch /prog by accident. Where "Abelson's fat schlong" is etched forever on the front page. I smile to myself and close the tab.

Name: Anonymous 2015-02-22 19:16

>>24
It was frozen at good time considering that.

Name: Anonymous 2015-02-24 0:39

>>23
I agree.

Name: Anonymous 2016-06-10 20:58

If you want to actually be precise, it's true that the C compiler never sees comments. What we refer to as the "compiler" is actually a set of several programs - the preprocessor, the actual compiler that converts high-level code into assembly, the assembler which turns that into object code, and the linker which generates an executable file from the object code. Comments are removed by the preprocessor, before the compiler ever sees them.

Name: Anonymous 2016-06-10 21:08

What are you sliding?

Name: Anonymous 2016-06-10 21:58

>>28
Not him, but shitty /pol/\/g/ threads it looks like.

Name: Anonymous 2017-01-05 18:47

>>15
newline followed by

>>16
Nobody cares about your primitive caveman bytefuck languages where you can't even use things before defining them.
lolwut? something HAS to be defined before using it, at no point during execution is ANY computer resource in an undefined state. it can be undefined BY THE LANGUAGE SEMANTICS, but that just means it's either implementation-dependent or based on the previous state of the computer. and in any case, that leads to non-deterministic behavior from a language specification point of view. "easy" languages let the programmers get away with using undefined variables by defining all POTENTIAL variables before they're declared, which is why programs written in those languages take so long to start up. Java for example uses a 1MB stack, so every single program you write in Java has to define the equivalent of 262,144 undeclared ints before the program can even start executing.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List