Skip to main content
12 events
when toggle format what by license comment
Sep 22, 2021 at 18:58 vote accept Algo
Sep 22, 2021 at 15:20 answer added JDługosz timeline score: 4
Sep 22, 2021 at 12:58 answer added jdt timeline score: 3
Sep 22, 2021 at 9:32 answer added G. Sliepen timeline score: 4
Sep 22, 2021 at 2:30 comment added spyr03 If I was to have a speculative guess, appending to a string is not performant. It may be causing many reallocations that are not necessary. You could try putting the characters into a plenty big enough char array, and then converting that to a string once it has a full number in it.
Sep 21, 2021 at 19:56 comment added G. Sliepen There is also the issue of sample skid; when a perf event triggers the instruction pointer that is sampled might not be at exactly the instruction that was executing at that time due to the processor's pipeline. See this article for more information.
Sep 21, 2021 at 17:30 comment added user673679 Yeah. That sample point probably covers multiple lines of code on your screen but your IDE may not track that, or be able to highlight multiple lines properly. If you find the right screen, the profiler should be able to give you much more detail about what's included in that 59.53%).
Sep 21, 2021 at 17:19 comment added Algo @user673679 I ran it more than once, and I always get the same line.
Sep 21, 2021 at 16:59 comment added user673679 I think the highlight is just inaccurate (it should cover multiple lines). Judging by the next profiler sample point, it probably covers the whole while loop.
Sep 21, 2021 at 16:48 history edited Algo CC BY-SA 4.0
added 61 characters in body
Sep 21, 2021 at 16:44 comment added William Bradley Perhaps your profiler sees your code spending a lot of time checking for 'e' simply because that's a common case, and the actual bottleneck is with your while loop in general?
Sep 21, 2021 at 16:17 history asked Algo CC BY-SA 4.0