Reputation
9,848
Top tag
Next privilege 10,000 Rep.
Access moderator tools
Badges
1 21 43
Newest
 Nice Answer
Impact
~511k people reached

Jun
23
comment What is the best aproach for coding in a slow compilation environment
@John: Yeah, a well-written compiler should (IMHO) be I/O bound.
Jun
22
comment How to find bottlenecks in an application?
@ChocoDeveloper: Revisiting this 2 years later. It's like interviewing 10 candidates for a job, versus 1000. With the small number you're going to pay close attention to each one. With the large number you're going to skim, missing important details. That's the trouble with most profilers - it's not the taking of samples, it's the conversion to numbers.
May
8
comment How does modulus work?
To answer your question, there is an integer division instruction, which produces both a quotient and a remainder, and the modulus is just the remainder. But pay attention to @uesp comment. The division takes around 1e-9 seconds, even if the compiler hasn't precalculated it (which in this case it has). The cout << takes around 1e-3 seconds, so this is like trying to weigh a hair by weighing the Bison who owns it.
Apr
28
comment List comparing techniques for faster performance
+1 @cap7: This is what I would do - sort both lists and use a merge loop. You're not clearing the lists, just indexing through them.
Mar
26
comment Does code generation increase the code quality?
@gbjbaanb: I agree. That's why I said enough flexibility. To me, the issue is not the code generator itself, but the domain-specific-language that serves as its input. If that DSL is too flexible, the user has to swim around in options. If it is not specific enough, the user has to work around its limitations. I can give examples of these.
Mar
17
comment Writing Z80 table based assembler/disassembler
Unless you are running this on a tiny machine, you don't really need to worry about storage size of the table.
Feb
5
comment Is there a name for the problem of representing state twice and then getting out of sync?
@JimmyHoffa: Thanks. I guess I'm a bit of an outlier sometimes, but I am impressed with the fact that there are some really talented and helpful people on these sites.
Feb
5
comment Is there a name for the problem of representing state twice and then getting out of sync?
@JimmyHoffa: I use events at low frequency, like once in a while just do a regeneration, but for high frequency messages are just too likely to get dropped or duplicated. Plus, often they are self-cancelling like "insert X", then "oops, don't". Plus, notifications get buried in classes, and they can easily go wild, soaking up CPU.
Feb
4
comment Does it matter how I format the name of a function?
@user61852: I had a student once who named his variables after swear words. He was trying to be clever. The compiler didn't care - the program ran fine. But the compiler is not the only reader of the code :)
Feb
4
comment Does it matter how I format the name of a function?
@user61852: It's a case of "when in Rome...". Naming conventions not only help in communicating what you've done to others, but also to yourself. Set the code aside, then come back in 3-5 years, and you'll see what I mean.
Dec
17
comment When should we work on GC optimization?
If you want to save time in GC, first save time in new. This illustrates the method I use, which works in any language. You could well find that you are doing news that could be avoided, such as by re-using old objects rather than making new ones.
Nov
10
comment Finding common prefixes for a set of strings
@cruppstahl: Sorry, I understand you want just one level, but I have a hard time understanding why.
Nov
10
comment Finding common prefixes for a set of strings
@cruppstahl: Check my edit above. That should work for any content.
Nov
3
comment Does code format affect performance?
Learn how to get performance. It's not what you think, and the skill will never leave you.
Sep
26
comment How important is to initialize a variable
It's a case of once-burned-twice-shy. Since I've seen/had bugs caused by uninitialized variables, especially pointers, it's become a habit. For performance, it's usually irrelevant. For memory leaks, not really an issue.
Aug
19
comment In the days of modern computing, in 'typical business apps' - why does performance matter?
Performance matters if it's poor.
Aug
19
comment How meaningful is the Big-O time complexity of an algorithm?
@Snowman: Right, and when they do mention "profiler", they mention "gprof" in the same breath, which in my opinion is worse than saying nothing. Check the second answer here.
Aug
17
comment How to approach program design with respect to data strucutres and algorimths - is there an equivelant of the OO design process for d.s.'s + algs?
I work with some very competent and professional people. They work well as a team, and their code is nothing if not well-written. However, there are still serious performance problems, as is likely when any software gets large. The problem is, programmers are taught how to find logic bugs, but not speed bugs. They are only taught platitudes, like "profile", or "measure", or quotations from Knuth. The reason is, their teachers have not been responsible for performance of large software. The method I recommend is this.
Aug
15
comment What does “context-free” mean in the term “context-free grammar”?
Very nice explanation. Although, a Turing machine's tape does not need to be infinite, only unlimited. There can be a tape-factory at either end that, when the machine bumps into it, simply makes more tape. That way, at any point in time, it is finite.
Jul
31
comment What is meant by “OOP hides the state”?
@Phil: Thanks for the tip on Racket.