#memoization — Public Fediverse posts
Live and recent posts from across the Fediverse tagged #memoization, aggregated by home.social.
-
#Development #Techniques
You can’t cancel a JavaScript promise · But you can return a promise that never resolves https://ilo.im/16c0nc_____
#Programming #Coding #JavaScript #Promises #Cancellation #Memoization #WebDev #Backend -
#Development #Techniques
You can’t cancel a JavaScript promise · But you can return a promise that never resolves https://ilo.im/16c0nc_____
#Programming #Coding #JavaScript #Promises #Cancellation #Memoization #WebDev #Backend -
The Useless “useCallback”, by @tkdodo.eu:
-
The Useless “useCallback”, by @tkdodo.eu:
-
🚀 Ah, yes, the riveting world of dynamic programming with Σ-types in Lean—because who wouldn't want to verify their #memoization techniques while sipping on a nice cup of existential dread? 🤓 If you thought solving recursive #algorithms was thrilling, just wait until you read about turning it into a 17-minute snooze-fest! 💤
https://tannerduve.github.io/blog/memoization-sigma/ #dynamicprogramming #Σtypes #Lean #existentialdread #HackerNews #ngated -
🚀 Ah, yes, the riveting world of dynamic programming with Σ-types in Lean—because who wouldn't want to verify their #memoization techniques while sipping on a nice cup of existential dread? 🤓 If you thought solving recursive #algorithms was thrilling, just wait until you read about turning it into a 17-minute snooze-fest! 💤
https://tannerduve.github.io/blog/memoization-sigma/ #dynamicprogramming #Σtypes #Lean #existentialdread #HackerNews #ngated -
Memoizing the Cache in Laravel, by @amitmerchant.bsky.social:
https://www.amitmerchant.com/memoizing-the-cache-in-laravel/
-
Memoizing the Cache in Laravel, by @amitmerchant.bsky.social:
https://www.amitmerchant.com/memoizing-the-cache-in-laravel/
-
Between immutability and memoization, you might have to choose, by Rémy Hannequin
https://thoughtbot.com/blog/between-immutability-and-memoization-you-might-have-to-chooseFreezing objects, pre-computation, cache, #memoization.. which one you can use, when it's worthy?
-
Between immutability and memoization, you might have to choose, by Rémy Hannequin
https://thoughtbot.com/blog/between-immutability-and-memoization-you-might-have-to-chooseFreezing objects, pre-computation, cache, #memoization.. which one you can use, when it's worthy?
-
[Перевод] React useCallback() — полное руководство
Всем привет! На связи Разобраться с useCallback() полностью
-
React. Обновление узлов и мемоизация
В процессе разработки современных веб-приложений производительность часто становится одним из ключевых аспектов, которые волнуют и разработчиков, и пользователей. Пользователи ожидают молниеносного отклика, а разработчики стремятся создать приложения, которые работают быстро и эффективно. Одним из мощных инструментов, позволяющих достигнуть высокой производительности в React-приложениях, является мемоизация. Мемоизация помогает значительно сократить количество вычислений и, соответственно, обновлений интерфейса, что положительно сказывается на общей скорости и отзывчивости приложения. В данной статье мы заглянем "под капот" движка React и увидем, как именно происходит обновление узлов. Параллельно рассмотрим и основные принципы мемоизации и её применение в различных типах компонентов.
-
Advent of Code Day 2 — Cube Conundrum
The hands of the Christmas elf are far, far larger than they appear.
https://chasingdings.com/2023/12/02/advent-of-code-day-2-cube-conundrum/
-
Iuri de Silvio is presenting the talk "Caching everywhere" at the DjangoCon Europe 2023 in Edinburgh 🏴🦄🚀
-
Iuri de Silvio is presenting the talk "Caching everywhere" at the DjangoCon Europe 2023 in Edinburgh 🏴🦄🚀
-
A Guide to Memoization in #Ruby, by @appsignal
https://blog.appsignal.com/2022/12/20/a-guide-to-memoization-in-ruby.html
> Memoization is a caching technique to make your Ruby application run more efficiently and faster.
> In this post, we'll look at the benefits of memoization and when to use it in your Ruby application. We'll also look at some memoization mistakes to avoid.
-
A Guide to Memoization in #Ruby, by @appsignal
https://blog.appsignal.com/2022/12/20/a-guide-to-memoization-in-ruby.html
> Memoization is a caching technique to make your Ruby application run more efficiently and faster.
> In this post, we'll look at the benefits of memoization and when to use it in your Ruby application. We'll also look at some memoization mistakes to avoid.
-
Nice write up by Prateek Karki on using memoization techniques in React. Great skill to learn about if you haven't looked into it before.
-
Nice write up by Prateek Karki on using memoization techniques in React. Great skill to learn about if you haven't looked into it before.
-
Of course we could choose to avoid #memoization altogether. Avoid #currying. Avoid retaining state. Just pass around argument parameters and recalculate function results every time.
It'll be safer.
And it'll be slower.
So we must come up with something better.
And that can't be achieved with the current version of the #Java #programmingLanguage or the #JVM.
It can't be achieved on current o.s. kernels or any consumer computer chips.
#Immutability is an illusion. -
It's just asking for trouble. It's like asking for a #hacker to go in and change a few bits in memory you thought wasn't shared - but you were wrong. Thank you, #Spectre and #Meltdown #vulnerabilities.
And it's worse, because you didn't even know that #memoization was used: it's a black box, a hidden implementation, remember? How do you test what you can't see? How do you trust what you can't know?
Well. Partially through making the code public. Yay, #openSource #software. -
And the same occurs with any value remembered beyond a very short lifetime, and sometimes even then. (Looking at you, #multithreading.)
Because a file system is #mutable, our #software #application suffers the effects of the change. And if the #programmingLanguage allows for mutability, like #Java does, then it too suffers the effect of change on remembered values. Especially when we, the programmers, can't see that values were remembered. Which is what #memoization does. -
A file on a file system is a prime example of #memoization: it retains data that was the result of some operation. The o.s. provides ways to read and change the contents.
Let's assume the file contains some configuration at the start of a program. The program reads it and alters its processing accordingly.
Then halfway through, a human interferes and changes the file contents.
How does the program react? Does it change? Does it crash? Does it corrupt some data? -
It is wrong to dismiss #unittesting of #memoization as useless or impractical, just because it's an invisible implementation that is subject to change.
It is wrong because of scope, life cycle, and mutability. Let me work that out.
Reference scope determines where the reference is available to a process. Life cycle says when it becomes available, how long it stays available, and what happens in the mean time. And mutability dictates that the refered value can change without notice. -
#Memoization is a technique used to optimize #software performance. It avoids having to recalculate / reload / reprocess every time a function produces a result.
But it requires some memory object to use later, retaining the result in a scoped way. The implementation of the memory usually is hidden in private internals.
And that raises 2 questions:
- how can we test it?
- should we test it?
The latter depends on the remembered object's scope and life cycle. And that is important. -
#Currying in #FunctionalProgramming is a way to temporarily retain a value for later use. The value is retained in a new, scoped function instance.
Wait.
What?
Isn't that quite similar to what the #ObjectOriented #Java #programmingLanguage does when it retains a value in a Class instance, for later use?
Yes.
Yes, it is.
And that makes currying feel like cheating. Which makes #FP languages that allow it, feel like a hack.
So, what else is there? #Memoization?