« first day (475 days earlier)      last day (4466 days later) » 

5:00 PM
Is there any function similar to asm read time-stamp counter ?
in c++
like__asm {
rdtsc;
}
 
dude , don't break the queue :)
 
:D
 
Don't use rdtsc.
 
@DzekTrek Which OS/compiler. MSVC has an intrinsic for it.
 
@sbi, I have one q. about mapping in flash. I have solved it long time ago, so when 30 days passes, I will call you to answer it, and will give you 2 points. :D Plan of the evil masters. Hehe
 
5:02 PM
@DzekTrek __rdtsc();
 
For high-resolution timer you want timeBegin/timeEnd or QueryPerformanceCounter on Windows, and gettimeofday on POSIX.
 
@CatPlusPlus I want __rdtsc instead of QueryPerformanceCounter
 
Don't use rdtsc.
 
Don't use __rdtsc for time. But it's useful for other things.
 
why should I use a function with additional overhead?
 
5:04 PM
Because the overhead doesn't matter.
 
sbi
@DzekTrek What bad thing have I done that you dare to threaten me with a question about Flash?
 
@CatPlusPlus oh really?
 
@Mysticial , but what if TSD flag is not clear, how can rdtsc then be executed?
 
Unless you can prove it with a profiler, of course.
 
sbi
If you think hornets are scary, (don't) have a look at this. Just the sound of such a swarm is quite impressive. Never mind the swarm intelligence...
 
5:04 PM
__rdtsc() has a 200 cycle latency anyway. A function call overhead is negligible.
 
@abyx , I have no idea for that function, will check it now.
 
Hey, keynote starts in 30 minutes, isn't it?
 
@sbi, :D It's a way for revivial badge.
 
@CatPlusPlus profiling != speed measurements
 
What?
Or: wat.
 
5:06 PM
@DzekTrek All the other high performance counters indirectly call rdtsc so if TSD is set, none of them will work either - unless they're in ring 0.
 
when I want to know how fast foo is, I don't profile it, I measure how long it executes
 
It's a meaningless measurement.
 
sbi
@CatPlusPlus Right, 5:30pm UTC. Herb Sutter about C++11, IIRC.
 
for you, maybe.
 
@Mysticial yeah, famous privelege level. OK, will check @abyx answer, cause I deem it's a good one.
 
5:07 PM
No, how the hell can you tell the bottleneck by picking an arbitrary function and seeing how long it happens to execute?
 
sbi
@Abyx No, Herb speaks for everybody who wants to listen.
 
I'd measure it by putting it into a loop and running it for several seconds. It might take some tricks to match the cache effects though.
 
@sbi ok
 
That's not how you optimise.
 
Which would be faster: string or mathematical manipulation for geometric structures?
 
5:08 PM
It's just silly.
 
@CatPlusPlus Yes it is a valid way to optimize. :)
 
No, it's a valid way to waste time.
 
sbi
@ElectroNerd Which would be faster, an octopus or a hawk?
 
@sbi Then I take it that mathematical manipulation would indeed be faster.
 
sbi
@Mysticial It is — once you know it's a bottleneck. Otherwise it's a common bloddy newbie error.
 
5:09 PM
@CatPlusPlus who said about bottlenecks?
 
Profile first, optimise later. Algorithmic improvements over micro-optimisations.
@Abyx If it's not a bottleneck, then it doesn't have to be optimised.
3
 
@CatPlusPlus I take it you haven't done any serious performance-critical code.
 
@sbi That is going to be slightly difficult with this L-system I am trying to mimmick...
 
@CatPlusPlus and when it's bottleneck, and it should be optimized?
 
sbi
@ElectroNerd No, a hawk won't be faster in water (Nor will math manip be faster for appending a character to the string).
 
5:10 PM
@Mysticial you were right! :) MVSC needs #pragma intrinsic(__rdtsc) . :)
 
So you write code by deciding "oh, this function call must be slow, let's spend three days on that bit"?
Synthetic benchmarks are useless, because you need the damn context.
 
sbi
@CatPlusPlus Shrug. All newbies do this. Many professional programmers never stop doing so.
 
@sbi I know it's wrong but I can't stop myself :(
 
@CatPlusPlus No, you use the timers/profilers to identify that the function is slow. Then you use them again to track your progress on how much it's been optimized.
 
If a function call takes 10 seconds, but is next to something that takes 3 days, it's a fucking waste of time to optimise that function call.
 
5:12 PM
@sbi OK, for all practical purposes in what I'm attempting to do, you are right. This is string manipulation and that's the way it is.
 
@Mysticial See, that's profiling, not guessing.
But you don't measure function alone, you measure function in the context of the entire program.
 
@CatPlusPlus It can actually be done both ways.
 
Ciao
 
sbi
@ElectroNerd I have no idea what you are talking about. You dropped a question that was absolutely meaningless without some added context, and I only pointed this out. Now you tell me I was right as if I had answered your question one way or the other. I dunno what to make of this.
 
anyway I still don't get why should I use QueryPerformanceCounter instead of cpuid+rdtsc
 
5:15 PM
hey guys
 
sbi
@Abyx Because the latter will be a nightmare to port to some of the more funny platforms Windows 8 will run on?
Hey puppy.
 
@Abyx You could use either one. But using QueryPerformanceCounter saves me the mess of having to measure how many rdtsc ticks occur per second.
 
just come back from my microprocessors exam
I wrote about six lines and then walked out
apparently, it was necessary to memorize the instruction manual for the 8051
 
sbi
@DeadMG You might want to add some context. Is six lines to many or too few lines?
 
5:17 PM
many too few
 
is it possible to watch yesterday's GoingNative speeches?
 
@Mysticial QueryPerformanceCounter returns same ticks, but with unknown error
 
it had two essay-style questions
 
sbi
@MooingDuck I bet.
 
one of which related to one processor, and one another, and answering both of which required a reference-level knowledge of the relevant processor
 
sbi
5:17 PM
@DeadMG "Too few" as in "the others must have written twice as many" or "several hundred lines"?
 
@Abyx Really? I always thought it was somewhat normalized. Though I never tried to match it against rdtsc() though.
 
sbi
@DeadMG Oh.
 
presumably in the realm of about 100-200 lines between both of them
and I realized that I hadn't studied the reference manuals
so there was no way I could possibly answer the question
so I walked out
 
sbi
@DeadMG Then you have answered with 3-6% of the expected amount of text. If one of my students would have done this, they'd either get 3-6% of the credit for that exam, or 120% — depending on whether the answer was correct and exhausting.
 
I mean, these manuals run to hundreds of pages of content
lol
 
5:19 PM
Any better substitute for QueryPerformanceCounter(
__out LARGE_INTEGER *lpPerformanceCount
); ?
 
I fully expect to get in the 3-6% range
 
@DzekTrek I usually build a wrapper around it that returns a double.
 
Xeo
@DzekTrek <chrono>
 
@Xeo That works too if you have C++11
 
@DeadMG: 8051 is a microcontroller or a microprocessor?
 
5:21 PM
do I even know the difference?
it's from over thirty years ago, and can address like 128 bytes of memory
 
Xeo
auto start = std::chrono::high_resolution_clock::now();
// do work
auto time_taken = std::chrono::high_resolution_clock::now() - start;
 
did the distinction even exist then?
 
@DeadMG: oh
 
@Mysticial @Xeo nice solutions. Will combine both
 
Xeo
@Mysticial Or if you have boost.
 
5:21 PM
in any case
I spend my time in lots of highly dubious ways
but a walking reference manual is a new low
 
Xeo
10min till GN~
 
@Abyx en.wikipedia.org/wiki/Time_Stamp_Counter "With the advent of multi-core/hyperthreaded CPUs, systems with multiple CPUs, and "hibernating" operating systems, the TSC cannot be relied on to provide accurate results" "There is no promise that the timestamp counters of multiple CPUs on a single motherboard will be synchronized." "the CPU speed may change due to power-saving measures taken by the OS or BIOS, or the system may be hibernated and later resumed"
 
sbi
In an exam by one professor whose lecture consisted of him putting the pages of his script on the overhead and reading them to us, and whose exam questions required intimate knowledge of everything that was in his (100pages) script, I wrote at the bottom of the stack of papers: "If I was able to learn address books by heart, I'd either earn some money in a circus, or lots of money on TV." His revenge was to let me pass with the worst possible mark.
 
@MooingDuck thx, I know that.
 
@Abyx use GetPerformanceFrequency or whatever it's linux equivalent is
 
sbi
5:24 PM
@DeadMG I worked in a company in the US in the mid-90s which employed the 8051 a lot.
 
well
I'm not saying that it's a bad processor, or something
 
sbi
@DeadMG That's a hole in the ground.
 
merely that encyclopaedic knowledge of it is an insane requirement
 
@sbi was that the timer chip?
 
sbi
@AlfPSteinbach I dunno. I programmed Windows machines there.
 
5:26 PM
Oh, i found it. Microcontroller. Perhaps te one in the keyboard
 
sbi
@DeadMG I forgot that the mid-90s might, for you, be just as long ago as the neolithic. You probably still had to wear diapers back then. Me, I was working hard on siring a child at the time. :)
 
lol
admittedly, I remember very few things
 
talks of micro-stuff reminds me, what is a decent simulator of 8085 on ubuntu/windows?
 
@sbi He he, working at siring a child, for the best part of the 1990s... :-) lol
 
3 years old, family obtains first computer and I write first program
4 years old, I go to school and discover they can't teach me anything new because I'm ahead of their hardest content
 
sbi
5:28 PM
@AlfPSteinbach Please don't come here and attempt to type to us when you are drunk. Or at least take the time to fix the typos after you have posted a message.
 
It's starting.
 
Xeo
room topic changed to Lounge<C++>: We're closed. Everybody's watching GoingNative. channel9.msdn.com/Events/GoingNative/GoingNative-2012 [c++] [c++11] [c++-faq]
 
sbi
@AlfPSteinbach The mid-90s.
 
6 years old, can't achieve as much as my siblings because school doesn't offer the tougher examinations anymore
 
sbi
@CatPlusPlus Oh, thanks!
 
5:29 PM
@sbi i'm using a laptop, sorry. i'm sorry that you think that means drunk
 
@sbi "type to use"?
 
nice reminder
 
Everyone has laptops.
 
sbi
@DeadMG Of course, that had to happen. Thanks.
 
@CatPlusPlus u now, like laptop keyboard
 
5:30 PM
I don't have a laptop.
 
We're in GN mode, this is commentary.
 
Xeo
@AlfPSteinbach I think @Cat was referring to GN
 
sbi
@AlfPSteinbach I'm using a laptop, too, so I happen to know that laptops have shift keys and the letter "h".
 
Audio!
 
@sbi I considered just waiting for the two minutes and then pointing it out :P
 
5:31 PM
Large box with C/C++ on it.
 
sbi
6 hours ago, by R. Martinho Fernandes
You bastard!
 
the link from yesterday's VLC stream doesn't seem to work - is there a new one for today's GoingNative?
 
They have a morning.
 
sbi
Damn, Herb is starting so eloquently.
 
Oh, that's what the box is.
 
5:32 PM
@sbi herb's good at language
 
Lol, floppies.
 
I'm half-surprised I don't have to use IE to watch it...
 
sbi
@kfmfe04 Use the new URL and just slide back.
 
In the topic.
 
sbi
5:32 PM
@Mysticial I have. No Silverlight in my FF.
 
thanks. i don't have earplugs though
 
I just installed Silverlight. Was worried I'd have to reboot.
 
@Abyx geisswerks.com/ryan/FAQS/timing.html conclusion is: don't try to read the registry to get the timer frequency; you're asking for trouble. Instead, do it yourself.
 
Xeo
AND STILL NO VARIADIC TEMPLATES. :(
 
But ARM!
We're all benefiting from ARM!
Who needs variadic templates if we have ARM.
 
5:34 PM
@Xeo yeah, that sucketh Big Time(TM)
 
STL is hiding somewhere.
 
sbi
@CatPlusPlus I thought disarmament was the new armament?
 
Herb's very enthusiastic about parallelism
 
@MooingDuck I don't need CPU frequency for speed measurements at all. It's enough to compare ticks.
 
but i think he's lost the big picture
 
5:35 PM
@Mysticial one of the things that programmers should be worried about.
 
@sbi hmm...
Your input can't be opened
VLC is unable to open the MRL 'mmsh://117.121.254.14:80/msstudios_live2_med?MSWMExt=.asf'. Check the log for details.
 
parallelism revolution is about fine-grained stuff, like Linda. not like 4 threads
 
@sbi thx but no silverlight
 
Among first with move, among last with variadic templates.
 
5:38 PM
@DzekTrek Well, I have 4 monitors of shit open right now... and 3 VS projects with a shit-ton of unsaved shit... I'd shit in my pants if I had to reboot.
 
@Mysticial save
 
I have save-on-focus-loss in vim.
 
More like, I don't want to reopen my 30 windows...
 
sbi
@Mysticial Shift+Ctrl+S
 
@CatPlusPlus :) how does that work? like, vim detecting uncoherent input? heh.
 
5:40 PM
@Mysticial Why don't you save it? :) Also VS has save on loss - get to last . ;)
 
sbi
@Mysticial That I know. I dread having to reboot more than once a month. Just reopening 100-200 FF tabs almost freezes the machine for a several minutes.
 
Oh, see, now here's a good news.
 
user784668
Am I the only one who reboots once a day?
 
Non-VS-bound releases.
 
Everything I have open (save for my Mathematica document) is saved. But I can't save the 30 windows that I have open right now. (and I don't wanna have to re-login into the 4 machines that I'm remote desktop/SSH'ed into right now)
 
Xeo
5:41 PM
Good stuff.
 
sbi
@CatPlusPlus Yeah.
 
They should have done that 4 years ago, but still.
 
guys, wait till you really get something
 
ah, judging from the figure, they're going to add variadic template Real Soon Now, after the Beta verson
 
Xeo
initializer lists -> template aliases -> constexpr -> variadics
 
sbi
5:43 PM
So he has talked about his employer's product for 15mins now, and only now he comes to C++11. Sigh. That's a a sixth of the talk gone for advertisements.
 
@Mysticial as I can see your compute Pi programm is reaching 3 million
 
@DzekTrek 3 million?
 
Xeo
@sbi he got 90 minutes.
 
sbi
@Xeo :b
 
what was the bit.ly C++11 link?
 
5:44 PM
@Mysticial digits
 
@DzekTrek Are you looking at a screenshot or something?
 
@Mysticial something other. ;)
 
Xeo
Ugh, singleton!
 
5:50 PM
@Mysticial Sorry to ask, but as I can see you learn Japanese. :) Why so?
 
@CatPlusPlus Huh. They don't seem to have accepted the idea of student/hobbyist developers :P
 
These fields aren't required.
 
I watch the live stream in full screen mode in a virtual machine in window mode.
 
Xeo
lol
 
Now I can resize the video and position it neatly aligned with the chat window.
 
5:52 PM
@DzekTrek What in the world are you looking at? Where's this information that's helping you stalk me? ;-D
 
@CatPlusPlus done. of course i mentioned support for standard main. also, that they should support custom character types for std::basic_ostringstream, as the standard intended (I think). Silly with a compiler that doesn't.
 
They can't really get rid of WinMain.
 
user784668
@AlfPSteinbach Support for standard main?
 
@Mysticial sorry, but I saw your mystical name and I had to see who you are. :)
 
@CatPlusPlus right. but they can fucking support main. as GNU toolchain does
 
5:54 PM
It does.
 
I don't care about main.
 
@DzekTrek lol
 
you have one folder all about japanese learning, so I thought you learn Japanese
 
int main(int argc, char **argv) works just fine.
 
user784668
@AlfPSteinbach Have you ever considered checking whether it already supports main?
 
5:55 PM
@StackedCrooked i think you should care about main. because it's about getting them to make the foundations firm first. before constructing all kinds of ivory towers
 
SDL used to #define main WinMain (Perhaps it still does, it's a few years ago.)
 
SDL defines main to SDL_main.
 
@Fanael think about it
 
@DzekTrek huh? Where's that? I don't recall having that.
 
And SDL_main is called by either real main or WinMain.
You can't define main to WinMain, because the signatures are not compatible.
 
5:56 PM
:2538234 i don't think others here have a problem understanding what i wrote. if you want detailed explanation i can create a chat room to teach you?
 
That's the strategy to not fear of anything. I was just guessing as you can see. ;) @Mysticial
Just keep up the good work. ;)
 
@DzekTrek So basically you're saying that I just got trolled... well played...
 
user784668
@AlfPSteinbach Why can't you do that here?
 
@Mysticial yep, no reason for any checkings. Just relax.
 
@Fanael because to the others it will just be noise
 
5:59 PM
Stoodvector.
 
sbi
Did the loudness just drop noticeably or is it at my end?
 
It did.
 
It dropped.
 
I like to see that some people use Windows on Japanes or any other exotic language :)
 
I was wiping my screen when the sound dropped and found that very confusing.
 
5:59 PM
Japanese is not an exotic language
 

« first day (475 days earlier)      last day (4466 days later) »