profile

Timing the CPU time of a python program?

心不动则不痛 提交于 2019-11-28 01:05:30
I would like to time a snippet of my code, and I would like just the CPU execution time (ignoring operating system processes etc). I've tried time.clock(), it appears too imprecise, and gives a different answer each time. (In theory surely if I run it again for the same code snippet it should return the same value??) I've played with timeit for about an hour. Essentially what kills it for me is the "setup" process, I end up having to import around 20 functions which is impractical as I'm practically just re-writing my code into the setup section to try and use it. Cprofiles are looking more

OpenGL core profile incredible slowdown on OS X

天大地大妈咪最大 提交于 2019-11-27 21:54:21
问题 I added a new GL renderer to my engine, which uses the core profile. While it runs fine on Windows and/or nvidia cards , it is like 10 times slower on OS X (3 fps instead of 30). The weird thing is, that my compatibility profile renderer runs fine. I collected some traces with Instruments and the GL profiler: https://www.dropbox.com/sh/311fg9wu0zrarzm/31CGvUcf2q It shows that the application spends its time in glDrawRangeElements. I tried the following things: use glDrawElements instead (no

How to analyze golang memory?

爱⌒轻易说出口 提交于 2019-11-27 16:52:51
I wrote a golang program, that uses 1.2GB of memory at runtime. Calling go tool pprof http://10.10.58.118:8601/debug/pprof/heap results in a dump with only 323.4MB heap usage. What's about the rest of the memory usage? Is there any better tool to explain golang runtime memory? Using gcvis I get this: .. and this heap form profile: Here is my code: https://github.com/sharewind/push-server/blob/v3/broker The heap profile shows active memory, memory the runtime believes is in use by the go program (ie: hasn't been collected by the garbage collector). When the GC does collect memory the profile

iOS Facebook Graph API Profile picture link

懵懂的女人 提交于 2019-11-27 15:33:50
I am trying to retrieve the link to the profile picture... So far the graph API call : [facebook requestWithGraphPath:@"me/picture" andDelegate:self]; returns the image itself as Data. When I make the call : [facebook requestWithGraphPath:@"me/picture" andDelegate:self]; I do get an array of picture with the link for each of them. Is there anyway to get some sort of similar thing for the profile pic, at least just the link... Or is it not possible? If someone has already been through this please let me know. Cheers, Sami. make the graph request: NSMutableDictionary *params =

Make Maven Proxy/Server settings configurable based on location?

让人想犯罪 __ 提交于 2019-11-27 13:45:15
问题 So I'm not sure what the best way to accomplish this is, but basically I have a laptop that I use at work for Maven projects. It works fine when I'm at work, but as soon as I walk out of the door of their corporate proxy and maven server, I often have to do alot of hand-fudging of the settings.xml file when I'm at home if I'm not VPN'ed in: We have a corporate-installed Maven Repository proxy server to store some of our own artifacts and handle being the middle-man for our commonly used

Best way to profile memory usage in a Java application?

随声附和 提交于 2019-11-27 12:53:03
问题 I realize that similar questions have been asked about this before here on SO, but let me describe exactly what I need to do: I have a set of tests which run a command line java application and I'd like to add memory profiling to them. One option I see would be to add code (possibly using 3rd party tools/libraries) to my application that would provide a memory snapshot. Another option would be to use a third party tool which manages/instruments my application and the JVM for me (and ideally

Profile Memory Allocation in Python (with support for Numpy arrays)

爷,独闯天下 提交于 2019-11-27 11:11:09
问题 I have a program that contains a large number of objects, many of them Numpy arrays. My program is swapping miserably, and I'm trying to reduce the memory usage, because it actually can't finis on my system with the current memory requirements. I am looking for a nice profiler that would allow me to check the amount of memory consumed by various objects (I'm envisioning a memory counterpart to cProfile) so that I know where to optimize. I've heard decent things about Heapy, but Heapy

Using ASP .NET Membership and Profile with MVC, how can I create a user and set it to HttpContext.Current.User?

a 夏天 提交于 2019-11-27 09:47:56
问题 I implemented a custom Profile object in code as described by Joel here: How to assign Profile values? I can't get it to work when I'm creating a new user, however. When I do this: Membership.CreateUser(userName, password); Roles.AddUserToRole(userName, "MyRole"); the user is created and added to a role in the database, but HttpContext.Current.User is still empty, and Membership.GetUser() returns null, so this (from Joel's code) doesn't work: static public AccountProfile CurrentUser { get {

Do you know the maven profile for mvnrepository.com?

China☆狼群 提交于 2019-11-27 09:46:31
问题 I am trying to include some dependencies in my maven project. These dependencies are not available in the default Mven 2 repository http://repo1.maven.org/maven2/. They are available at http://mvnrepository.com/ But I couldn't find the profile for this site to include in my settings.xml Does anyone know what this repository's url and profile is? Thanks. 回答1: Once you've found your jar through mvnrepository.com, hover the "download (JAR)" link, and you'll see the link to the repository which

Where are the gcov symbols?

若如初见. 提交于 2019-11-27 09:23:24
问题 I'm trying to compile a simple app with gcov and getting the following link errors: gcc AllTests.o CuTestTest.o CuTest.o -o TestTest AllTests.o: In function `global constructors keyed to 0_RunAllTests': /home/p7539c/cutest/AllTests.c:26: undefined reference to `__gcov_init' AllTests.o:(.data+0x44): undefined reference to `__gcov_merge_add' CuTestTest.o: In function `global constructors keyed to 0_TestCuStringNew': /home/p7539c/cutest/CuTestTest.c:30: undefined reference to `__gcov_init'