Skip to content
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

Python rewrite #41

Closed
wants to merge 5 commits into from
Closed

Python rewrite #41

wants to merge 5 commits into from

Conversation

joshmoore
Copy link
Contributor

Sorry, I couldn't resist. Don't worry about saying "thanks, but no thanks"; I won't mind. If you're interested, here's what I did:

  • Modified the syntax to python (i.e. minimze git diff --word-diff) with all tests passing
  • Change to a full pythonized version with all tests passing
  • Added full float support (Floats #28); this changed the sparkles slightly
  • Added support for negatives

This all is about an order of magnitude faster:

/tmp/spark $ time ./spark -- '0,10,100,1,10,1,10,20,10,40,50,30,10,30,50,60,40,20,304,50,40,50,50'
▁▁▃▁▁▁▁▁▁▂▂▁▁▁▂▂▂▁█▂▂▂▂

real    0m0.023s
user    0m0.013s
sys 0m0.010s
/tmp/spark $ time ./spark.sh -- '0,10,100,1,10,1,10,20,10,40,50,30,10,30,50,60,40,20,304,50,40,50,50'
▁▁▁▃▁▁▁▁▁▁▂▂▁▁▁▂▂▂▁█▂▂▂▂

real    0m0.290s
user    0m0.092s
sys 0m0.229s

If this is something that anyone wants to consider, my next step would be to remove print_tick loop, since with float support we can compute the tick directly.

But now I should get back to real work. :)

@joshmoore joshmoore mentioned this pull request Nov 16, 2011
@holman
Copy link
Owner

holman commented Nov 16, 2011

Cool.

@holman holman closed this Nov 16, 2011
@joshmoore
Copy link
Contributor Author

Streams in 7879797. ;) Thanks for the distraction!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants