-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RFC: Contributed shootout pidigits.jl to Julia and created shootout directory #693
RFC: Contributed shootout pidigits.jl to Julia and created shootout directory #693
Conversation
…e examples; it is a straighforward rewrite of the Python version available on the shootout. Also had to modify the bigint.jl module and corresponding gmp_wrapper.c in order to make 'divmod' and 'lshift' available. Without the printouts (commented out in the code), the speed is on par with Python -- use the timeit macro now available in timing.jl (also in shootout directory) and adapted from perf.jl. Also moved fasta.jl to that new shootout directory.
Overall, looks fine. Can we make And I missed this earlier; Github only adds linkbacks from other issues if you use the # syntax. Let's do that now: #660. |
Thanks for the comments pao. I've committed all corrections, but did not add the variable number of repetitions in the timeit macro, because I don't know how to simulate default values in macros. By the way, I took the original timeit macro from the perf.jl file in tests/perf. Apparently, it gives better results than both @time and tic toc. I pushed the corrections to my master, but in between I have other small commits, so I don't know if you'll want to take everything. Tell me how you'd like to proceed. I also have some questions on the performance : 1/ why isn't it faster than python, 2/ why is the print and show so slow compared to Python, 3/ how to make macros with varying number of arguments (helpful to specify default values like in the timeit macro if I wanted to add an optional 'number of repetitions' parameter, 4/ why does pidigits.jl take up so much memory (try pidigits(10000), and saturates my 8GB ram, while it works well for the python version. Python's version : http://shootout.alioth.debian.org/u64q/program.php?test=pidigits&lang=python3&id=2 |
I can't answer most of your questions (you may want to bring them up on julia-dev), but I can recommend a course of action for the commits; we'll copy them to a topic branch so you can do a pull request on that: $ # First, create a clean copy of JuliaLang:master
$ git branch -t upstream remotes/origin/master #assumes you have the JuliaLang remote as "origin"
$ git checkout upstream
$ git pull
$ # Then, make a branch for shootout code
$ git checkout -b topic/shootout #you could call this something else; this is my convention
$ # And get the commits you actually want
$ git cherry-pick 892a03a 61af6d3 1e7ffad
$ git push mine HEAD #assuming your remote is named "mine" Then, submit a new pull request from the head of the topic/shootout branch you just pushed (Github will put a "recently pushed" banner on your julia repository page with a button for that), mention "#693" in the message body so it links to this conversation, and close this request. Routine cherry-picking isn't the way you should be working, but I think it's the best way to get you back on track in this case. Remember, branch early, branch often! |
Thanks for the detailed and patient help pao. On Wed, Apr 11, 2012 at 12:51 AM, pao <
|
…code. Also: added some documentation for pidigits ; added an option to print the intermediate digits as requested by the shootout, leaving it as a non-default option because printing is so slow in Julia compared to Python...
Hi,
After issue #660, I send the pidigits.jl, hopefully the first in a series.
I added divmod and lshift from gmp.
The pidigits.jl code runs as fast as Python's given on the shooutout website, and I had to comment out the printouts that took much longer than for Python -- I don't know Julia well enough to see how to optimise the code any further.
I also created a separate directory for the shootout codes, in the examples directory, because it's a project in itself as someone mentioned in issue 660.