GithubHelp home page GithubHelp logo

keithreid-sfw / stern_brocot_comparison_julia_vs_python Goto Github PK

View Code? Open in Web Editor NEW
3.0 1.0 0.0 105 KB

speed comparison of Stern Brocot between Julia and Python

License: MIT License

Jupyter Notebook 100.00%

stern_brocot_comparison_julia_vs_python's Introduction

Stern Brocot comparison Julia vs Python

#Python version

Python 3.7.6 (default, Jan 8 2020, 19:59:22)

[GCC 7.3.0] :: Anaconda, Inc. on linux

#Julia Version

1.8.1 (2022-09-06)

Date 19 Feb 2023

#Box Spec

OS: Ubuntu 22.04.1 LTS x86_64

Kernel: 5.15.0-60-generic

Shell: bash 5.1.16

CPU: AMD Ryzen 9 3900X (24) @ 3.800G

Memory: 64Gb RAM

#Intent:

Implement Stern Brocot in Python and Julia using TDD and nothing too clever

For speed comparison

Roughly simlar logic in the two versions

I love Python and Julia This is a fair but real-life test in a nerd's attic Using the versions I had to hand And the way I normally code And the same archiecture on the same afternoon etc.

Python

1 layers 0.000002879590399970766 seconds

2 layers 0.000005017571400003362 seconds

4 layers 0.000014577579199976754 seconds

8 layers 0.00019980101569999533 seconds

12 layers 0.0033494253342999402 seconds

13 layers 0.0067446708239000145 seconds

14 layers 0.013931729978600016 seconds

15 layers 0.030198445934199937 seconds

16 layers withdraws, estimated to take 10 minutes total

Julia

1 layers elapsed time (ns): 1590 0.000002 seconds

2 layers elapsed time (ns): 1770 0.000002 seconds

4 layers elapsed time (ns): 1350 0.000001 seconds

8 layers elapsed time (ns): 1410 0.000001 seconds

12 layers elapsed time (ns): 1980 0.000002 seconds

13 layers elapsed time (ns): 1670 0.000002 seconds

14 layers elapsed time (ns): 2030 0.000002 seconds

15 layers elapsed time (ns): 2150 0.000002 seconds

16 layers elapsed time (ns): 2220 0.000002 seconds

24 layers elapsed time (ns): 2310 0.000002 seconds

32 layers blows up RAM

stern_brocot_comparison_julia_vs_python's People

Contributors

keithreid-sfw avatar

Stargazers

 avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.