News for hackers. Stuff that matters.
Re:Bun 1.1 by triyambakam on Tuesday April 02, 2024 @12:14AM (#39902324)
I used to think so too, but that was because I had never really used Python. I still think Ruby is a mess, but it's so amazing how easy it is to manipulate data in Python, and so much faster.

I recently wrote a Node/Bun/Deno app that parses a 5k line text file into JSON.

The JavaScript on any runtime takes 30-45 seconds.

The Python implementation is sub 1 second.

I would not have been able to finish the tool so quickly if I were stuck relying on JS.

I still love Typescript but I'm not as blind about it now.

Re:Bun 1.1 by Jarred on Tuesday April 02, 2024 @12:16AM (#39902337)
What does the code do? 30-45 seconds to parse a 5k line text file into JSON sounds like something is going very wrong
Re:Bun 1.1 by dcre on Tuesday April 02, 2024 @01:41AM (#39902732)
That runtime doesn't make any sense. This script creates a 1,000,000 line CSV string and then parses it into JSON in 700ms with Bun, and this is doing both things the slow way, creating the string with a giant array map and join, and parsing with a giant split('\n') on newline and map.

https://gist.github.com/david-crespo/8fea68cb38ea89edceb161d...