Hacker News new | past | comments | ask | show | jobs | submit login
Why is printing “B” dramatically slower than printing “#”? (stackoverflow.com)
260 points by marcopolis on Feb 24, 2014 | hide | past | favorite | 116 comments



This post highlights the issue with overly zealous mods on SO who marked the question as off topic. Nothing about this is off topic, and it turned out to be very interesting answer.


The post was put on hold because the OP failed to provide the information the community would need to reproduce the issue. What good is a programming problem if no one else can reproduce it?

To have it reopened, all the OP needs to do is give the community all the information they need to reproduce the issue. Should we ask any less?

It's also worth noting that the question was not closed by moderators (denoted by diamonds next to their name), but by members of the community with high reputation (> 3000). These users have community moderation powers by virtue of their reputation, but are not moderators per se.

If you have over 3000 reputation, you could vote to reopen.

Full disclosure: I am an elected moderator for Stack Overflow: http:stackoverflow.com/users/16587/george-stocker


A) The community did find the answer, regardless.

B) Someone is gifting free interesting content to the site; even if it's imperfect does the reaction have to be so harsh? This is, personally, exactly why I never post on stack overflow. You're acting like you're doing them a favor by letting them post there, when they're doing you a favor by giving you interesting content in the first place.


The community, not moderators, closed the question. The community also had an answer based on "Pure speculation" which means they can't replicate what the OP asked.

A user can gift all the free interesting content they want. But if it's not scoped or on topic, then it's not scoped for the site or on topic and would be closed and/or deleted. Just because Rodney Dangerfield turns up to your bedroom and starts making jokes doesn't mean it's the time or place.


I think the point isn't who closed it, but the fact that this type of knee-jerk reaction is fostered within the community at SO. I see, time and time again, questions that are closed as off-topic because it's not a "1+1=X" problem/solution, even though there is much value to be gained -- within the programmer community -- of the question being asked, and the responses that are given.

If I have a problem that I can't reproduce but is related to programming, and there's a chance that someone else has also had a similar problem and found the solution, SO does not offer a way for me to connect with that person.

On the other hand, if an unreproducible problem is posted and allowed, and multiple answers are given, there's a good chance one of those will point the OP in the right direction, and in turn, someone else that faces that same issue. There should be nothing wrong with this type of interaction. If someone feels it's a waste of their time, by all means, move on.

I know this has been argued ad nauseam, both here and on meta, and is likely something that will never change, but that's not the point of my post here. I just think it's worth defending the stance that the SO community is too quick to close programming related topics that may not be completely black and white.

By the way, programmers.stackexchange.com also suffers from this same fate, and I don't think this question would have received a much different response there, even though it's supposed to allow more open-ended questions.


My experience with programmers.stackexchange.com is that it's even worse. I won't go near that place.


I agree, 1000%. Once every several months, I work up the gumption to ask another question there, only to see it down-voted and close-voted into oblivion. It's a pit of misanthropic hostility.


Your analogy is bad because it would be very hard to ignore Rodney Dangerfield in your bedroom, but it is very easy to ignore these sorts of questions. At worst it sits there and nobody comes up with an answer. We aren't running out of bits.


It's easy to ignore singular questions like this. It's harder to ignore such questions when they compose 99% of the content source you're interested in, without ignoring the entire source - including the 1% of signal you care about. We are certainly running out of mental bandwidth all the time, even if you aren't counting them as bits.

This sort of community moderation exists in an attempt to proactively ensure a high signal to noise ratio (SNR), by discouraging noise. While it's an entirely valid stance to say they're overreacting and that the ratio is fine, that there's no slippery slope, etc., here's another viewpoint:

I don't read from the raw Stack Overflow firehose of posts. It doesn't even have a 1% SNR to me. Higher SNR sources (searches, specific links from my communities) will occasionally take me there, but as a primary source of information I don't even think of consulting it. I took a stab at participating in one of the far more niche subtopics - gamedev, relevant to me both professionally and unprofessionally - and still found it didn't have a high enough SNR to hold my interest beyond gathering a few hundred internet points. I found myself ignoring the majority of these sorts of questions, and quickly progressed to the natural conclusion of ignoring the site entirely.

And that's fine: Not everything is for everyone. But there are presumably those who still participate in the site directly who would prefer to remain doing so, yet find the SNR low enough to be pushing their own tolerances.


Thanks, this is a great response. I see the problem now. The SNR is plenty high enough for my use case of searching for content and following links, but to ensure that a high number of the links that I follow have good answers, it's important to keep the SNR reasonably high for those who are looking through the firehose for things to answer. Makes sense.


We aren't "running out of bits", but we have a highly limited amount of time and screen real-estate.

The reason it was marked as such was so that other people didn't waste time on an unreproducible problem until it was fixed to be reproducible.

At worst, it sits there and wastes many people's time, thus getting in the way of actually reproducible questions getting seen and answered.

Note, that this is not regarding this one question, but thousands - certainly there are a large number of items selected for moderator action.


And yet...the answer was found without this "required information".


Real-world analogies don't always work on virtual problems, even when they seem to on the surface. Unfortunately, this seems to be the standard way to respond [0].

[0] https://news.ycombinator.com/item?id=4273324


"You have a lovely home, sir. A lovely home. It would be perfect if it weren't for the broken front door and putrid, bloody trail up the stairs to your bedroom."

"People say to me, 'Rodney, what's it like being a zombie?' and I say, 'It would be better if I didn't have to send half of every brain I find to my ex-wife!' No respect for the dead. No respect."

"People say you gotta hit zombies in the head. I definitely agree. All I know is that when I was alive, and someone kicked me, it didn't take me all night to find where my nuts landed. I get no respect."


I don't think it's the time for Rodney Dangerfield to show up anywhere to start making jokes.


The 'pure speculation' was merely because the answerer was not setup at the time with the tools/environment to replicate. It does not mean that the results could not be replicated under any tools/environment however.


Or that he's written low level display code that behaves exactly that way. I have. It was for a LCD display module on a 68HC11 microcontroller probably in the mid 90s. It was something like a 4x16 and you inevitably have to make some value judgements in your "display a string" subroutine about what to do when stuff doesn't fit on a line. It only had a quarter K of ram and not much more onboard eeprom so I never tried to display thousands of letters. My eventual strategy was overwriting (keep it small and simple).

What do you do with a quarter K? It was basically a very slow beamwidth analyzer for LEDs using a photodiode and a R/C servo. So the 3 dB down aka half power beamwidth of this integrated LED and diffusion lens system measures as X degrees. Kind of important if you're making LED based signs. I believe I was only using about 4 bytes of memory. No need for interrupts as it had a rather advanced hardware timer system that made excellent PWM for driving servos. The world is full of interesting problems that require lots of computation but very little stored state.


Neat stuff!

Yes, that's the "I'm pretty sure it's this without even attempting to replicate the result" possibility (and also probably the most likely).


Sibling poster Manishearth, you appear to be hellbanned and are being secretly censored (nobody sees your posts unless they view dead posts).


B) "Someone is gifting free interesting content to the site". That's the attitude that caused Yahoo! Answers. SE has a higher quality bar, so that there are good, answerable questions. If a question seems unanswerable to many (not due to incompetence but due to incompleteness/clarity/broadness/etc), then it is put on hold. It can be reopened if it gets fixed; putting it on hold lets it get fixed, whilst preventing answers (which might use the wrong interpretation, etc) while it is getting fixed. Saves time for all.


The question asker didn't gift free interesting content to the site. The question asker emptied their chamber pot on the front lawn. The answerer left interesting content and got rewarded for it.


The post was put on hold because the OP failed to provide the information the community would need to reproduce the issue. What good is a programming problem if no one else can reproduce it?

Disagree. OP failed to exclude some possibilities by doing multiple randomized trials and so on (or at least stating whether he had done so), but he supplied the source code and a description of the behavior that was perfectly adequate to understand the issue. Nothing personal, but your post above is the epitome of deflecting a question instead of engaging with it.


You can't reproduce the issue with the information he gave. He doesn't tell what operating system, terminal, java version, etc he is using.

Most likely his problem is due to his terminal (my guess: cmd.exe/powershell in Windows) and not his program code at all.

FWIW here's my non-reproduction of his problem, on Linux amd64, Sun Java 1.6.0, running in urxvt:

    real	0m3.568s
    user	0m0.616s
    sys	0m1.152s

    real	0m3.393s
    user	0m0.648s
    sys	0m1.060s
In other words, I could not reproduce the issue with the information he provided.


Neither cmd, nor PowerShell are the console host (which would be doing things like outputting text in a character grid), so they're both very far removed from the problem. Heck, when a console program is running it doesn't even need a shell, nor does the parent shell (if there is one) even know when the program outputs text.


It would be very nice if we could share or clone our development environment and let contributors on Stackoverflow play with it, rather than try to reproduce on their computers. Of course it has its dangers, but once solved, it would be an awesome addition to SO.


I agree it would be cool, and occasionally useful, but I think overall such a tool would be a negative. The goal of boiling down code to the smallest, most portable example which demonstrates the problem isn't just to get more effective help. It's a vital step in isolating the issue, and when duly used, often results in the problem being found without help. Furthermore, it gives answers the quality of being more useful to those who find the question later. That's because while two actual pieces of code that have the same bug will appear almost unrelated, their simplest reductions will bear similarity to each other.

I think adoption of a tool that just lets one share their dev environment would discourage this sort of due diligence, and encourage the useless "here's a dump of my code please fix it"-type questions.


At first, I thought you were being flippant, but then I realized in horror that you were serious.

While I know you were coming from a good place -- I'm all about automating a testable problem (i.e. TDD, write failing tests first), and I think in the right hands, this would be a nice tool -- I could only see SO using this to further enforce strict requirements in what they consider a "valid" question.

"You must set up a lab environment that fully replicates the issue in question."

Maybe they wouldn't let it go that far (I would hope), but I think it would head in that direction.


This is the exact goal of vagrant. The toolset is already in place. I just wish more people use it while filing issues.


I see jsfiddle.net being used this way for jQuery, plugins, themes, etc. While I really hate doing HTML + CSS + JS work, the outgrowth of jsfiddle and the like is brilliant.


>" What good is a programming problem if no one else can reproduce it?"

Well in real life, those are the tough ones and where help is more appreciated.

The only bugs that I remember are the ones that were random or that nobody else could reproduce and yet were there.


And yet the community did find the answer.


> The post was put on hold because the OP failed to provide the information the community would need to reproduce the issue.

Why close other's question because of your own incompetence? Why the fuck prevent a question from been answered because only five retards can't get it?

Isn't the solemn purpose of the site is to wait until someone who is capable of reproducing it and solve it?


I would say if a member with a high reputation has moderation powers then that member is a moderator. They may not have the full powers of an elected moderator, but that would just make them a lower level moderator. It seems the comment can be considered accurate.


Hard to see how the OP could have tracked this down, being unaware of the feature.


They reopened it too. That's what you get when you have a collaboratively-managed site: folks working things out, in public. Nobody said democracy was pretty...


My top voted and most commented on question (IIRC question has 60ish votes, top answer has 90ish, about 20 answers), which I asked five years ago, was closed as off topic about a year ago - FOUR years after 50+ people found it useful enough to vote and comment.


My answer with 219 votes was deleted after 4 years by moderator Andrew Barber. It's really disheartening.


Do you lose the karma points that you gained from that answer?


Yes. At least if the question is actually deleted and not kept around as closed.


If you're interested in this, then please vote in the SO elections, going on now. http://stackoverflow.com/election


But everyone is saying "elect me and I will close and flag more posts"


Sadly true. I despise those who take pride in flagging & downvoting just for the heck of it.


"you need at least 150 reputation to vote" - heh


It should be noted that the question has since been re-opened.


The problem the user was facing had nothing to do with java. I'd say that is pretty much off topic.


It had everything to do with programming, which is on topic.

It's a pet peeve of mine. At least 10% of the time I google for a answer to a programming question it takes me to a StackOverflow question... which has been marked off-topic.


If all your searches are "which language is better?", "what IDE should I use?" and "what is already in the documentation that I should consider a hidden feature?" then yes, it will be closed as off topic.


What an unnecessarily antagonistic and intellectually dishonest response. It's obvious from the GP's post that he's talking about actual problems with possible solutions, and for what it's worth I've experienced the same phenomenon.

Give your interlocutors the benefit of the doubt, it makes for a much more productive conversation.


How was the user to know that the problem had nothing to do with java without knowing what the problem was? From the user's point of view, the answer could have easily been something like "oh yeah, java prints the 'B' character very slowly for xyz reason".


According to this logic, is asking whether this is a java problem also off topic, because it's not a java problem? So you have to know the answer to know if the question is on topic. Great rules.


Lawyers have a saying "Never Ask A Question If You Don’t Know The Answer". Not sure how it applies, but reminded me of it.


I'm going to guess this actually means "A lawyer defending or prosecuting a client should never ask a question in a courtroom if they don't already know the answer"


Usually I understand why a question is marked as offtopic, but I think an issue like this, that someone writing Java is encountering, is definitely on topic.

If a future person were to run into that problem I think that is the most appropriate location for the answer to reside.


I once asked how the old DOS games was written, and they closed because it was not specific enough, although it gained enough upvotes and more than 5 good answers.


Do you have your answer now?

It was mostly Assembly, Turbo C, Microsoft C or DJGPP in the later games

Making the sound card work -> sucked (especially with interrupts >= 10)

Multithreading -> Non existent / roll your own

Graphics -> VGA or Vesa. Vesa was nice except for one small detail (next point)

Real mode -> Awful! The bane of developers! Going from "16-bit" to 32-bit protected mode is like going from the worse stick-shift car to an automatic modern car.

The reason this also influences VESA is that VGA fits into a segment 320*200 = 64k anything bigger doesn't.


Entirely unrelated, but this headline made me notice that Chrome finally supports entering " in the find-in-page box and having it match so-called smart quotes.


Yup, it's definitely done that for a while. It does become a pain when you actually want to locate quotes that need smartening up, though.


Why? Why would you do that to the world? Smart quotes are about the dumbest concept that has ever existed.


‘Smart quotes’ are actually more typographically ‘correct’; that key on your keyboard is a prime symbol which is NOT the same as an apostrophe or a single quote mark. Apart from reducing ambiguity, they also look a lot nicer (in decent fonts), particularly at larger font sizes. I cringe when I see a prime (or ‘straight quote’) symbol being misused on TV or in print.


Just curious, how do you feel if a font, let's say it is a decent font, is designed to make the apostrophe look like a prime symbol?


What's so dumb about them? Do you like your opening and closing parenthesis to be the same, too?


No, which is why they have separate keys on my keyboard, unlike smartquotes, so I can always easily specify exactly which I want.

Also nobody magically switches my parentheses around out from under me.


There are many wonderful characters that don't have their own individual keys on your keyboard. Heck, there are a lot of characters that require at least one meta key to be pressed in combination with another key, and single quote marks are accessible in exactly that way on my keyboard too (Mac, YMMV).

And, yes, autocorrect can be a PITA, especially when it's not actually getting things correct, but that's a different, albeit related, issue. We should really refer to quote marks, or apostrophe (which are often rendered as curly, and are the characters that autocorrect switches to), and the prime symbol (which is the unadulterated character that you get with the non-meta-pressed key on your keyboard), rather than using the term 'smart quotes'.


Not to detract from the substance of your post, but the unshifted keyboard key pretty much universally generates an ASCII apostrophe (U+0027, '), not a prime (U+2032, ′, as used for feet and minutes, and while I'm babbling, the addition of a second prime for seconds is not a coincidence).

~~~~ wavy lines starting flashback ~~~~

ASCII 1967, in conjunction with its European counterpart ECMA-6, permitted the visual appearance of some characters, including the apostrophe, to be modified so that they could be used as accents when overstruck¹:

  ' " , ^ ` ~
  ˊ ¨ ¸ ˆ ˋ ˉ (using the modern Unicode spacing modifiers)
Later versions of ECMA-6 suggested that the accent interpretation be used only when the character was actually overstruck:

  In the 7-bit character set, some printing symbol may be
  designed to permit their use for the composition of ac-
  cented letters when necessary for general interchange of
  information. A sequence of three characters, comprising
  a letter, BACKSPACE and one of these symbols, is needed
  for this composition; the symbol is then regarded as a dia-
  critical sign. It should be noted that these symbols take
  on their diacritical significance only when they precede or
  follow the character BACKSPACE; for example, the symbol
  corresponding to the code combination 2/7 normally has the
  significance of APOSTROPHE, but becomes the diacritical
  sign ACUTE ACCENT when preceded or followed by the character
  BACKSPACE.²
Although this was fine for the printing teletypes in use when ASCII was first designed, early video terminals were too dumb to handle overstrikes, so it never caught on.

¹Revised American Standard Code for Information Interchange, from http://www.wps.com/J/codes/Revised-ASCII/index.html

²ECMA-6: 7-Bit coded Character Set, 4th Edition, August 1973, from http://www.ecma-international.org/publications/files/ECMA-ST...

~~~~ wavy lines ending flashback ~~~~


Please don't abuse tildes in this way; use the proper Unicode wavy-line character: ⌇


But your wavy line has the wrong orientation...

  2307 ⌇ WAVY LINE http://www.unicode.org/charts/PDF/U2300.pdf
What you most likely intended to present as an alternative is the...

  301C 〜 WAVE DASH http://www.unicode.org/charts/PDF/U3000.pdf
unicode smiley ➩ ☺


OK, looks like I need to go back to school for a bit before attempting to comment on this again! Thanks for the history lesson.


They don't have a dedicated key, I suppose, (but then again, you have to hit <shift> to get parens…) but smart quotes are <option>+{ and <option>+<shift>+{ on OS X, and configured to be <compose>, <, " and <compose>, >, " on my Linux machine.

Smart quote are a bit of a pain, but they do look nice. Really I prefer em dash, en dash, ellipses; I regret that OS doesn't have a keyboard entry for bullet. (Then, Linux doesn't either, other than entering in the code point directly with Ctrl+Shift+U or whatever it is.)


On OS X, you can type a bullet • with <option>+8.

You can also edit your keyboard layout to make certain characters possible or easier to type, using Ukelele (http://scripts.sil.org/cms/scripts/page.php?site_id=nrsi&id=...) for OS X.

I created a custom layout using Ukelele that makes typing smart quotes easier. With it, opening ‘ and closing ’ single smart quotes are <option>+[ and <option>+] instead of <option>+{ and <option>+<shift>+{, and double smart quotes “ ” are similarly more intuitive to type. I use it all the time. You can try it out yourself by downloading it from http://a.pomf.se/bipwcr.zip and moving the two files into “~/Library/Keyboard Layouts/”.


option-8 on my mac keyboard is •.


German Wikipedia uses proper quotes instead of the straight variety. I did a lot of wikignoming a while ago and fixing quotes (and non-breaking spaces, and citation formats) was among the things I did. Being able to quickly find straight quotes on the page is very helpful in that regard.


Meanwhile, Firefox continues to distinguish between e and é when searching, despite Chrome having fixed this bug years ago.


> this bug

"9001 Wrong Things Programmers Assume About Internationalization"

This behavior should at a minimum be locale-aware. I would be surprised if Firefox did that by default in my pt-BR profile.


(I'm not programming this kind of thing so please forgive my ignorance.)

Is that loose of a search not actually desirable in "find in page" instances?

In other words, are there many words where 'e' matching 'é' would actually generate a false positive? This is the only case I could see that would be problematic.

And even then "find in page" is usually used as quick navigation to the minimum matching search (high recall) and not about excluding all possible mismatches (high precision).


There are words in other languages, French for instance, that with an accent changed or removed have completely different meaning.


That is sadly true.

It's even worse than that. 'e' is the most used letter in french, but 'é' and 'è' are quite used too. 'ê' and 'ë' being rarer, but still existing.

So, I am exaggerating it a bit, but you can compare it to having to search for words with the consonants, because every vowel is considered the same by your search algorithm.

Yes, I'm pushing it, but you see the problem it can easily become in huge pages.


Why sadly?


What is sad for me is chrome new way of handling thing, not french accents (which can be a bother, but they're cute, so that's ok).

Most pages nowadays are small enough that it won't be a bother, but their still are some cases (newspaper posts, blog analysis, etc...) where accent sensitiveness will be an issue.


It should probably be aware to the language of the page, not your own.


No, no, no. The user needs to be able to predict the behaviour.


[deleted]


"Nice things" like searching for "cafe" on page A, finding "café" and thus concluding that search works like that, then searching for "cafe" on page B, not finding anything, and then discovering that page B actually did say "café"?


Does it depend on the locale, perhaps?


Ah, this is off topic and let me close it to show off my power... hmm, are we on SO?


I recall it doing that (for other symbols too) for quite a while. At least 4-6+ months, on stable channel.


Oh good lord. This question is more about properly isolating your tests (i.e. writing the characters to /dev/null and getting rid of the "random" call) and properly profiling code (which would show high CPU consumption on the console, not the program writing to stdout) more than anything "tricky" about performance.


The problem is, who on earth would have thought of printing to terminal would have a big penalty?


I've run into it before... I've had compiling etc. limited by the speed & size of my console window.

Isn't it common knowledge though? Cat some 1GB file to your terminal and notice it takes more than the <100ms it takes to cat it to /dev/null.


Never assume something is common knowledge! I've seen many links to mathematics things here on HN that I would consider "common knowledge" yet many people were unaware of them.


You also realize it when adding 'quiet' to the bootloard kernel params. No output => boot time decreased (sometimes halved)


> who on earth would have thought of

Everyone with >5 years of printf() debugging experience.


I remember minimizing the terminal window to make a script run faster. Taking the text rendering out of the execution path actually had a substantial speedup for long running scripts in some cases. It was one of those things you sort of picked up from other people along the way and assumed everyone knew.

Nowadays I don't know if the difference is noticeable enough to be common knowledge though.


I still have to think about it when i'm piping debug statements to a log... Conditional breakpoints are a similar case.


When you're using GNU screen or tmux, you notice that the CPU usage of these processes is sometimes notable.

Here's another way to increase your CPU load with apparently doing nothing:

$ cat /dev/zero


Hilarious! I never see confirmation bias in action so much as when SO answers get posted on HN:

"See, this is exactly what's wrong with SO."

"Really? Because it seems like a perfect example of why SO works perfectly."

Of course, I find I am increasingly disposed to read the comments that way...


Just shows that seemingly obscure questions can often show that there are underlying things you need to pay attention to!


This, incidentally, is a good user interface study. The terminal emulator works so well that most users don't even know it's there. But it's actually a pretty complex piece of software.


Apparently the answer had to do with terminal word-wrapping. A good test would be to write the output to a file instead of the terminal and compare the difference in timing.


A graph of wall clock printing speed vs line length for each character would have been highly enlightening. Of course we'd hope anyone who did that would figure it out themselves without posting the question.

If it wasn't a line length issue, it probably would have been

1) Proportional kern'd antialiased fonts some glyphs hardware accelerated some not.

2) Maybe for speed it only caches certain font glyphs but its an anti-accelerant strategy this time. After all, what normal person generates outputs like this?

3) UTF-8 to ASCII and or localization code gone wild or similar misoptimization.

4) You'd like to think a simple string printer and the fancy formatted string printer (aka printf and friends) are separate optimized routines but the simple printer might actually be a degenerate form of the formatted printer and the formatted printer has a severe hangup about certain characters. Maybe # is processed quickly but b gets processed extremely slowly because its regex'ing in a very inefficient way to find the \ as in \b.

5) remember LTRS/FIGS from baudot 5 bit teletype coding? Someone trying something "funny" with 3-d accelerated text rendering treating certain letters as 3-d sprites and some not and its getting all messed up and unoptimized this time. Someones LRU cache of 3-d glyph/sprites isn't as LRU as you'd like to think, perhaps.


I find it amazing that they actually got the correct answer. How on earth did they guess that?


The guesser comments that they have written word-wrap code before many times, and recognised the problem from experience.


Which reaffirms what I've been saying for a while: Plenty of programming prowess is creative pattern matching.


> How on earth did they guess that?

By acting quickly before 5 other power user close the question, of course.



answer it, then vote to close it, makes it exclusively the only answer.


Gamification and gaming the system at it's best.


There are terminals that do word wrapping?

Well, I shouldn't be surprised... There are people who try to code with a proportional font too, so I guess anything is possible, though it may not make sense to me.


The output console in many IDE in default configuration, the output console in many linux distros visual updater/installer (eg in xubuntu and mint), etc ...

Terminal is a very large word these days. In the SO post, he was using the output console of NetBeans.


I'm actually a little surprised that the answer wasn't something along the lines of "# is simple straight lines, while B requires a bunch of Bezier splines for TrueType to render." I guess the graphics cards must accelerate that or something. I'm surprised that line-breaking algorithms take that long.


About that, I wonder how common are path rendering extensions used ( like NV_PATH http://zrusin.blogspot.fr/2011/09/nv-path-rendering.html ). I'd be sad to hear that my cpu is wasting time on font rendering in 2014.


# probably has a decent number of splines in it as well around the corners. It depends on the font, of course, but the Ubuntu font, for example, certainly does.


1) Asking about running times on code with calls to an RNG ... remove the randomness first, profile repeatedly

2) Outputting to STDOUT can have some serious overhead depending on where you're actually rendering the text-- textview inside your IDE? Crazy, off-the-wall terminals? Let's dump this to a file and see how long it takes


reminds me of worldwide newbie python Unicode rage. The culprit was Windows's cmd.exe and Linux's LC_ALL


I bet if he had redirected the output to /dev/null it wouldn't be slower with 'B'.


good detective work!


Printing random boobs is slow, okay.


did you folks read the code?




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: