Did you ever want to play questions?

It’s maybe not the wiring that freaks me out, but the amperage and our scary old box?

5 Likes

Doesn’t that sound like a reason to start using this option? Haven’t I avoided any of that stuff since becoming an adult, since 1) it’s illegal and 2) I’m not in basic survival mode anymore? But doesn’t the fact that it’s becoming legal sound like an excellent reason to try it again, for good reasons rather than bad ones?

And hasn’t my daughter teased me that my medical issues in recent years have made a number of ‘illegal’ drugs legal for me (most recently, the codeine for my pneumonia, which I stopped taking after 48 hours because I don’t like what that stuff does to my brain)?

With the constant title changes, I’m not entirely sure…is this the questions thread, or am I incapable of writing declarative sentences anymore?

8 Likes

Or at least too much SOMETHING?

6 Likes

Am I not drinking too much coffee right now!?

2 Likes

Is it the thread title that’s changing, or is it YOU?

8 Likes

Don’t all the different opiates make me feel yucky? Wouldn’t I caution you to try a teeny, tiny little bit of an edible rather than smoking it because of the horrible feeling that smoke can introduce to your lungs if you’re not used to it? Doesn’t that sensation in your lungs really not help when you are trying to sleep soundly?

2 Likes

Have you tried storing the square root so you don’t have to calculate it every time?

1 Like

Insane in the membrane?

2 Likes

Who feels refreshed this morning?

12 Likes

Do you mean moving it out of the for() loop like so?

double s_n=sqrt(thenumber)+1;
for(int loop=5 ; loop<s_n ; loop+=6){

Doesn’t it seem like the compiler must optimize that already?

  $ time ./isprime.old
  ...
  real	0m6.677s
  user	0m5.609s
  sys	0m0.741s
  
  $ time ./isprime.newer
  ...
  real	0m4.302s
  user	0m3.310s
  sys	0m0.657s
  
  $ time ./isprime.newersqrt_precalc
  ...
  real	0m4.314s
  user	0m3.308s
  sys	0m0.650s

Do you mean building a precalculated a lookup table? Wouldn’t that probably help (and get rid of the cast too), but I’m not likely to spend time on it, since I’m lazy? Wouldn’t this thing be better written with a BigNum lib so you could find things like (1222*10^24397-2221)/9999 (which is a probable prime)?

1 Like

Is it possible that the compiler has some special case optimizations for sqrt?

int s_n= (int) sqrt(thenumber)+1;
for(int loop=5 ; loop < s_n ; loop+=6){

Will it make a difference to only compare int to int in the loop? Do I continue to be surprised at how much stuff I used to have to hand-optimize that is now just rolled into the compiler? Am I conversely equally surprised when apparently simple optims actually aren’t done by the compiler?

If you like optimizations, do you love profilers?

2 Likes

CSI San Jose: Code Optimization Crew?

4 Likes

Is that not literally my life?

Do I love this kind of problem because it’s relatively straightforward and involves no multithreading (and the Lovecraftian madness that comes with multithreaded optimization)?

5 Likes

Doesn’t it seem like no measurable change?
real 0m4.312s

Don’t I lean on timers and profilers since I kind of assume I have no idea what’s happening until I get some measurements? Would saying I ‘love’ profilers be a bit strong, though?

4 Likes

Why does threading have to be such a pain? Do you know how many hours I waste struggling with weird, nearly impossible to reproduce bugs in threaded code?

2 Likes

Is love too strong? The first time you use a profiler (pix / vtune / razor), is it not turning on a light in a room where you had previously been working in darkness, going only by feel?

2 Likes

Since my day job involves a lot of Ruby and Java, with some C (half kernel/half userspace), where the C’s usually not the bottleneck, and the perf. issues are often system things, can you see why I sometimes get a sinking feeling when I’m pulling out a profiler? Does profiling Java sometimes tell you something that’s technically correct but not helpful?

3 Likes

I’m looking at a callstack, but all I’m seeing is ph’nglui mglw’nafh Cthulhu R’lyeh wgah’nagl fhtagn

whoops, I forgot this thread runs on jeopardy rules. in the form of a question now:
what the fuck??

2 Likes

Which is more of a trainwreck?

  • Gun Threads
  • Feminism Threads
  • Racism Threads

0 voters

6 Likes

Can you make it a multi-choice poll?

7 Likes