Python vs. Julia with deeply nested dictionaries

  Рет қаралды 271

EKB PhD

EKB PhD

Ай бұрын

When creating a deeply nested dictionary, which is faster: Python or Julia? That's the question I seek to answer in this video, within the context of implementing the MERGE-multidimensional algorithm proposed here:
journals.openedition.org/lexi...
Here's my Python script:
github.com/ekbrown/scripting_...
Here's my Julia script:
github.com/ekbrown/scripting_...
#python # python3 #pythonprogramming #julialang

Пікірлер: 8
@exxzxxe
@exxzxxe Ай бұрын
This is the second time I have viewed this video. Thank you for performing the benchmark-testing work I would have had to do- saved me quite a bit of time. Now a question: Do you believe Mojo will progress to point where its dictionary performance will equal or exceed Python's?
@ekbphd3200
@ekbphd3200 Ай бұрын
You're very welcome! I'm glad that enjoyed it. I hope and assume Mojo's native dictionary will get faster with future releases. In the changelog for Mojo v.24.4 the creators say: "Significant performance improvements when inserting into a Dict. Performance on this metric is still not where we'd like it to be, but it is much improved." docs.modular.com/mojo/changelog#v244-2024-06-07 With the "still not where we'd like it to be" I assume that they will continue to work on the native dictionary.
@alextantos658
@alextantos658 Ай бұрын
And ome could also try out the Dictionaries.jl package in Julia that is much more performant and efficient than he base Julia Dict type.
@ekbphd3200
@ekbphd3200 Ай бұрын
Thanks for the idea. I just tried Dictionary.jl to get the frequencies of words across 40k files with 230m words, and it was only slightly faster than Base.Dict (47s vs. 51s). I'll have to implement Dictionary.jl with a deeply nested dictionary and see how it does.
@alextantos658
@alextantos658 Ай бұрын
@@ekbphd3200 ​ Thanks for the nice videos and the work! Besides Dictionary.jl, Julia offers several other options from DataStructures.jl, such as SwissDict and other data structures that are claimed to be faster. What I appreciate about Julia is its diverse range of options, often re-implemented within the language itself without needing to track/tune C implementations of basic operations.. Therefore, while comparing base types between languages provides valuable insights, it doesn't fully capture the extent of Julia's capabilities. PS: I am a Python user and fan too..
@ekbphd3200
@ekbphd3200 Ай бұрын
Here's a quick comparison with a simple frequency dictionary: kzfaq.info/get/bejne/iLWXhKSEsrTDnH0.html
@oterotube13
@oterotube13 25 күн бұрын
So at the end is Julia vs. C
@ekbphd3200
@ekbphd3200 20 күн бұрын
I guess. I don't know how Python's for loops compare to C's, but I guess the dictionary itself is implemented in C.
How much faster has Mojo's dictionary gotten?
7:40
EKB PhD
Рет қаралды 2,5 М.
Dictionaries.jl - for improved productivity and performance | Andy Ferris | JuliaCon 2021
27:12
Mama vs Son vs Daddy 😭🤣
00:13
DADDYSON SHOW
Рет қаралды 45 МЛН
WHAT’S THAT?
00:27
Natan por Aí
Рет қаралды 14 МЛН
What it feels like cleaning up after a toddler.
00:40
Daniel LaBelle
Рет қаралды 84 МЛН
Torvalds Speaks: Future of AI
9:36
Mastery Learning
Рет қаралды 52 М.
Why is Mojo's dictionary slower (!) than Python's?
12:16
EKB PhD
Рет қаралды 4 М.
Does Python's dictionary get slower as it gets bigger?
6:13
EKB PhD
Рет қаралды 1,2 М.
The REAL Three Body Problem in Physics
16:20
Up and Atom
Рет қаралды 463 М.
Julia in 100 Seconds
2:40
Fireship
Рет қаралды 696 М.
The Art of Linear Programming
18:56
Tom S
Рет қаралды 641 М.
Why Does Diffusion Work Better than Auto-Regression?
20:18
Algorithmic Simplicity
Рет қаралды 252 М.
Mama vs Son vs Daddy 😭🤣
00:13
DADDYSON SHOW
Рет қаралды 45 МЛН