News for hackers. Stuff that matters.
Re:Show HN: I'm building a non-profit search engine by Faaak on Sunday December 26, 2021 @07:03AM (#29691715)
Premature optimization is the root of all evil. Best to concentrate on the algorithm first, and then, maybe, improve it with a faster language.

Apart from that, the misconception that "python is slow" should die :-)

Re:Show HN: I'm building a non-profit search engine by Debug_Overload on Sunday December 26, 2021 @09:08AM (#29692451)
> Premature optimization is the root of all evil.

Is keeping performance in mind and choosing the tech stack accordingly really a premature optimization?

This might be the most abused phrase in CS history. Perhaps we should add "Premature optimization fallacy" to the list of cognitive errors programmers use as an excuse to not seriously think about performance.

Re:Show HN: I'm building a non-profit search engine by thatwasunusual on Monday December 27, 2021 @08:11AM (#29702195)
> Is keeping performance in mind and choosing the tech stack accordingly really a premature optimization? This might be the most abused phrase in CS history.

And it's often misquoted, and/or taken out of context. The full quote goes like this: "The real problem is that programmers have spent far too much time worrying about efficiency in the wrong places and at the wrong times; premature optimization is the root of all evil (or at least most of it) in programming."

Back then - this was the 60s, remember - CPU cycles were costly.

But with all theories, it stands its time in the sun. We have the same "problem" today, but in a different form. We call it "agile" today, though; make sure that the customer is happy before the programmer is happy. If the programmer is allowed to spend too much time on trying to become happy, the customer is either gone, or someone else came up with a better solution.

In regards to your specific "is keeping performance in mind and choosing the tech stack accordingly really a premature optimization" question, and keeping in mind OP's endevour, you're on the right spot. But the real question is how programmers _get there_.

By experience.

And in turn, by relating to clients more directly these days, programmers have to adhere to the laws that were separated from them back in the days. And your business isn't worth shit without customers, even if you have the best programmers that can create the best code from day 1.

Hence Knuth's quote, translated: "if you spend so much time on planning your journey that you don't reach your flight, you are getting nowhere."

Re:Show HN: I'm building a non-profit search engine by stevenally on Sunday December 26, 2021 @10:03AM (#29692868)
It’s a trade off between speed of development and performance. Speed of development seems like a good optimization for an experimental project?
Re:Show HN: I'm building a non-profit search engine by wolfgarbe on Sunday December 26, 2021 @07:55AM (#29692024)
Re:Show HN: I'm building a non-profit search engine by daoudc on Sunday December 26, 2021 @08:05AM (#29692092)
Agreed, this was my thinking - and since I'm better at Python, it's faster for me to get stuff done. I would like to rewrite it in Rust though, all help from Rustaceans gladly accepted!
Re:Show HN: I'm building a non-profit search engine by marginalia_nu on Sunday December 26, 2021 @07:24AM (#29691860)
In general, speed isn't the problem with search (at least the retrieval aspect), but memory efficiency is. Things like small object overhead and the ability to memory map large data ranges are extremely beneficial for a language if you want to implement a search index.

But I agree, get it working first, then re-implement it in another language if it turns out to be necessary.

Re:Show HN: I'm building a non-profit search engine by authed on Sunday December 26, 2021 @07:07AM (#29691747)
"Apart from that, the misconception that "python is slow" should die :-) "

Yeah it's not python that is slow, it's the interpreter.

Re:Show HN: I'm building a non-profit search engine by nulbyte on Sunday December 26, 2021 @07:11AM (#29691774)
Which interpreter? There are multiple. I found pypy to be quite reasonable; often faster than the standard C python interpreter.