|
|
Subscribe / Log in / New account

NumPy 1.20 has been released

NumPy 1.20 has been released

Posted Feb 24, 2021 8:12 UTC (Wed) by pgdx (guest, #119243)
In reply to: NumPy 1.20 has been released by ncm
Parent article: NumPy 1.20 has been released

I used to do competitive programming, where you need to write programs/algorithms that solve large instances of problems with typically 1–5 seconds time limit.

Python is a slow runtime, yes. However, we have seen several problems in competitions where Python (running on pypy, of course) outperforms other languages, e.g. Java.

Indeed, we once created a problem that we implemented solutions for in every language accept Java (go figure). We just assumed that since Python ran well within time limits, Java would manage too.

Half-ways through the competition we realized that it was not possible to solve that problem using Java.

I'm not a programming language expert, but I can accept your claim that there are "slow languages", however pypy is a quite snappy runtime.

(Now I teach competitive programming; those who can't do teach.)


to post comments

NumPy 1.20 has been released

Posted Feb 24, 2021 10:39 UTC (Wed) by sandsmark (guest, #62172) [Link] (2 responses)

I agree with you, but now I got curious about the problem that wasn't possible (or at least feasible in a competition) to solve with Java. Do you remember what problem was, or at least the broad strokes?

NumPy 1.20 has been released

Posted Feb 24, 2021 10:58 UTC (Wed) by ju3Ceemi (subscriber, #102464) [Link]

Starting a JVM is time consumming, and we are talking about a couple of second max for the whole program to run

NumPy 1.20 has been released

Posted Feb 24, 2021 11:17 UTC (Wed) by pgdx (guest, #119243) [Link]

I don't remember it precisely, it's probably 7 years ago, or so, but the problem was JVM startup combined with slow IO (parsing integers from stdin).

NumPy 1.20 has been released

Posted Feb 24, 2021 23:47 UTC (Wed) by atai (subscriber, #10977) [Link] (1 responses)

> Half-ways through the competition we realized that it was not possible to solve that problem using Java.

What is it with Java that makes it impossible?

NumPy 1.20 has been released

Posted Feb 24, 2021 23:48 UTC (Wed) by atai (subscriber, #10977) [Link]

never mind. you already answered the question


Copyright © 2025, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds