[sage-support] Re: sagenb files in multiple locations
On Dec 23, 11:44 pm, Mark Manashirov wrote: > Hi, > > Is there a reason why there are two copies of the notebook and simple > server files? > 1) $SAGE_ROOT/devel/sage/sage/server See http://trac.sagemath.org/sage_trac/ticket/11409 for the closest thing to full detail on this issue as you are likely to find. Good luck! - kcrisman -- To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to sage-support+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-support URL: http://www.sagemath.org
[sage-support] sagenb files in multiple locations
Hi, Is there a reason why there are two copies of the notebook and simple server files? 1) $SAGE_ROOT/devel/sage/sage/server 2) $SAGE_ROOT/devel/sagenb/sagenb It appears that only changes made to #2 have any effect on the server, so what is the purpose of #1? I'm preparing to submit a patch to fix a bug in the simple server api, so any help regarding this matter is greatly appreciated. Thank you. -- To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to sage-support+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-support URL: http://www.sagemath.org
[sage-support] Re: sage graph -- why is c_graph so slow??
Hello Jesse ! Well, for a start it wouldn't be very fair to compare graph libraries if you do not use our graph methods and recode your own ! You seem to have rewritten your version of "strongly connected components" to test the libraries, and such low-level methods are in Sage written in Cython, so this kind of running times are only those you would get if you use Sage graphs but refuse to use any of the methods present in the library :-D This being said, I just did some tests and if they are far from being as bad for Sage as yours are, I was quite disappointed myself. I was under the impression we were leaving NetworkX far behind, and it looks like we actually are behind in some cases, which will need to be fixed. Could I ask you to provide examples of codes which have different running times for NetworkX and Sage ? I guess you only use the add/remove edge/vertices methods in your code, which may be the explanation. When you are doing that you are actually calling Cython methods through Python functions, and spending more time calling methods than actually getting the job done Though to be honest I do not want to have to explain why Sage is slower, I would like to show that it is faster :-) Hence, if you can provide the code, we could begin to talk about the technical reasons. Good night ! Nathann -- To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to sage-support+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-support URL: http://www.sagemath.org
[sage-support] sage graph -- why is c_graph so slow??
Hi all, I'm benchmarking some graph libraries. I was excited to see that Sage's graph library has a backend implemented in Cython. Unfortunately, it seems to be orders of magnitude slower than a pure NetworkX implementation. Here a code summary: import networkx # read in test adjacency matrix using networkx G = networkx.read_adjlist('testmat%i.adjlist' % (N)) N = len(G.nodes()) E = G.edges() E = map(lambda x: (int(x[0]),int(x[1])), E) # set up test object tester.set_graph(E,N) The tester object is either of two classes, Tester_networkx or Tester_sage_cgraph, both of which set up the graph G in their respective implementations. For instance, if N is the number of nodes, tester is initialized as follows: import networkx ... self.M = networkx.DiGraph() self.M.add_edges_from( range(N) ) self.M.add_edges(E) or from sage.all import DiGraph … self.M = DiGraph(N, implementation="c_graph") # tried sparse=True, similar results self.M.add_edges(E) I am seeing the following timing results for the two different implementations: On a 1000 node graph, adding edges from node i to 100 randomly chosen nodes (slowest of 100 trials): networkx 298.02 usec sage_cgraph 749.83 usec Things get very bad when looking for strongly connected components (slowest of 10 trials): scc() -- 10 trials: networkx5846.98 usec scc() -- 10 trials: sage_cgraph 1363383.05 usec (231x networkx) I tried changing the Sage Graph implementation to "networkx", hoping to see identical behavior to the pure NetworkX version. Unfortunately, it is somewhere in between: scc() -- 10 trials: sage_networkx 104291.92 usec (20x networkx) I'm assuming I must be doing something wrong to see such large differences. Any ideas?? Thanks for your help, Jesse -- To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to sage-support+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-support URL: http://www.sagemath.org