#memoization

N-gated Hacker Newsngate
2025-06-20

πŸš€ Ah, yes, the riveting world of dynamic programming with Ξ£-types in Leanβ€”because who wouldn't want to verify their techniques while sipping on a nice cup of existential dread? πŸ€“ If you thought solving recursive was thrilling, just wait until you read about turning it into a 17-minute snooze-fest! πŸ’€
tannerduve.github.io/blog/memo

2025-06-16

#commonLisp #programming #amop #mop #metaobjectProtocol #exercise #closette #learnToCode (my own experience) #oop
screwlisp.small-web.org/amop/e

Today I simply share and solve (hopefully!) The Art of the Metaobject Protocol exercise 1.1

(the softball generic classes #memoization exercise from chapter 1)

I just added a lexical closure of hash tables.

@simoninireland wrote about the art of the metaobject protocol in his #lisp bibliography a year ago. simondobson.org/2024/07/23/the

Frontend Dogmafrontenddogma@mas.to
2025-04-26

Memoizing the Cache in Laravel, by @amitmerchant.bsky.social:

amitmerchant.com/memoizing-the

#laravel #caching #memoization

Esparta :ruby:esparta@ruby.social
2025-04-23

Between immutability and memoization, you might have to choose, by RΓ©my Hannequin
thoughtbot.com/blog/between-im

Freezing objects, pre-computation, cache, #memoization.. which one you can use, when it's worthy?

#ruby

2025-03-09

I started implementing some explorations in #Haskell but I had to ditch `data-memocombinators` because #MicroHs doesn't properly support #RankNTypes yet. Instead I'm doing manual #memoization with #array :

```
import Data.Array

-- memoized function, looks up in array
f :: Int -> Int -> Int -> Int
f = \x y z -> if inRange fBounds (x, y, z) then fArray ! (x, y, z) else 0

-- real algorithm, recursive calls use memoized function
f' :: Int -> Int -> Int -> Int
f' 1 1 1 = 1
f' a b c = sum [ f (a - 1) b c, f a (b - 1), f a b (c - 1) ]

-- array, generated with real algorithm
fArray :: Array (Int, Int, Int) [Bool]
fArray = array fBounds [ (i, f' x y z) | i@(x, y, z)<- range fBounds ]

-- array bounds
fBounds :: ((Int, Int, Int), (Int, Int, Int))
fBounds = ((1, 1, 1), (limit, limit, limit))

-- can be as large as necessary for the real problem,
-- but going too big consumes too much memory
limit :: Int
limit = 45
```

2024-12-26

[ΠŸΠ΅Ρ€Π΅Π²ΠΎΠ΄] React useCallback() β€” ΠΏΠΎΠ»Π½ΠΎΠ΅ руководство

ВсСм ΠΏΡ€ΠΈΠ²Π΅Ρ‚! На связи Π Π°Π·ΠΎΠ±Ρ€Π°Ρ‚ΡŒΡΡ с useCallback() ΠΏΠΎΠ»Π½ΠΎΡΡ‚ΡŒΡŽ

habr.com/ru/companies/spectr/a

#ecommerce #ecom #javascript #react #hook #memoization

2024-06-13

React. ОбновлСниС ΡƒΠ·Π»ΠΎΠ² ΠΈ мСмоизация

Π’ процСссС Ρ€Π°Π·Ρ€Π°Π±ΠΎΡ‚ΠΊΠΈ соврСмСнных Π²Π΅Π±-ΠΏΡ€ΠΈΠ»ΠΎΠΆΠ΅Π½ΠΈΠΉ ΠΏΡ€ΠΎΠΈΠ·Π²ΠΎΠ΄ΠΈΡ‚Π΅Π»ΡŒΠ½ΠΎΡΡ‚ΡŒ часто становится ΠΎΠ΄Π½ΠΈΠΌ ΠΈΠ· ΠΊΠ»ΡŽΡ‡Π΅Π²Ρ‹Ρ… аспСктов, ΠΊΠΎΡ‚ΠΎΡ€Ρ‹Π΅ Π²ΠΎΠ»Π½ΡƒΡŽΡ‚ ΠΈ Ρ€Π°Π·Ρ€Π°Π±ΠΎΡ‚Ρ‡ΠΈΠΊΠΎΠ², ΠΈ ΠΏΠΎΠ»ΡŒΠ·ΠΎΠ²Π°Ρ‚Π΅Π»Π΅ΠΉ. ΠŸΠΎΠ»ΡŒΠ·ΠΎΠ²Π°Ρ‚Π΅Π»ΠΈ ΠΎΠΆΠΈΠ΄Π°ΡŽΡ‚ молниСносного ΠΎΡ‚ΠΊΠ»ΠΈΠΊΠ°, Π° Ρ€Π°Π·Ρ€Π°Π±ΠΎΡ‚Ρ‡ΠΈΠΊΠΈ стрСмятся ΡΠΎΠ·Π΄Π°Ρ‚ΡŒ прилоТСния, ΠΊΠΎΡ‚ΠΎΡ€Ρ‹Π΅ Ρ€Π°Π±ΠΎΡ‚Π°ΡŽΡ‚ быстро ΠΈ эффСктивно. Одним ΠΈΠ· ΠΌΠΎΡ‰Π½Ρ‹Ρ… инструмСнтов, ΠΏΠΎΠ·Π²ΠΎΠ»ΡΡŽΡ‰ΠΈΡ… Π΄ΠΎΡΡ‚ΠΈΠ³Π½ΡƒΡ‚ΡŒ высокой ΠΏΡ€ΠΎΠΈΠ·Π²ΠΎΠ΄ΠΈΡ‚Π΅Π»ΡŒΠ½ΠΎΡΡ‚ΠΈ Π² React-прилоТСниях, являСтся мСмоизация. ΠœΠ΅ΠΌΠΎΠΈΠ·Π°Ρ†ΠΈΡ ΠΏΠΎΠΌΠΎΠ³Π°Π΅Ρ‚ Π·Π½Π°Ρ‡ΠΈΡ‚Π΅Π»ΡŒΠ½ΠΎ ΡΠΎΠΊΡ€Π°Ρ‚ΠΈΡ‚ΡŒ количСство вычислСний ΠΈ, соотвСтствСнно, ΠΎΠ±Π½ΠΎΠ²Π»Π΅Π½ΠΈΠΉ интСрфСйса, Ρ‡Ρ‚ΠΎ ΠΏΠΎΠ»ΠΎΠΆΠΈΡ‚Π΅Π»ΡŒΠ½ΠΎ сказываСтся Π½Π° ΠΎΠ±Ρ‰Π΅ΠΉ скорости ΠΈ отзывчивости прилоТСния. Π’ Π΄Π°Π½Π½ΠΎΠΉ ΡΡ‚Π°Ρ‚ΡŒΠ΅ ΠΌΡ‹ заглянСм "ΠΏΠΎΠ΄ ΠΊΠ°ΠΏΠΎΡ‚" Π΄Π²ΠΈΠΆΠΊΠ° React ΠΈ ΡƒΠ²ΠΈΠ΄Π΅ΠΌ, ΠΊΠ°ΠΊ ΠΈΠΌΠ΅Π½Π½ΠΎ происходит ΠΎΠ±Π½ΠΎΠ²Π»Π΅Π½ΠΈΠ΅ ΡƒΠ·Π»ΠΎΠ². ΠŸΠ°Ρ€Π°Π»Π»Π΅Π»ΡŒΠ½ΠΎ рассмотрим ΠΈ основныС ΠΏΡ€ΠΈΠ½Ρ†ΠΈΠΏΡ‹ ΠΌΠ΅ΠΌΠΎΠΈΠ·Π°Ρ†ΠΈΠΈ ΠΈ Π΅Ρ‘ ΠΏΡ€ΠΈΠΌΠ΅Π½Π΅Π½ΠΈΠ΅ Π² Ρ€Π°Π·Π»ΠΈΡ‡Π½Ρ‹Ρ… Ρ‚ΠΈΠΏΠ°Ρ… ΠΊΠΎΠΌΠΏΠΎΠ½Π΅Π½Ρ‚ΠΎΠ².

habr.com/ru/articles/821293/

#react #reactjs #reactjs #мСмоизация #memoization

2023-12-02

Advent of Code Day 2 β€” Cube Conundrum

The hands of the Christmas elf are far, far larger than they appear.

chasingdings.com/2023/12/02/ad

#AdventOfCode #chatgpt #copilot #haskell #memoization

A Christmas elf sitting on some snow covered, colored blocks in a snowy winterscape.
Mohammad HajiaghayiMTHajiaghayi@mathstodon.xyz
2023-06-01

Now (7pm ET Wed) watch youtu.be/AVBwSqH01L0 (FEEL FREE TO SUBSCRIBE TO YOUTUBE
@hajiaghayi

FOR FUTURE LESSONS) Lesson 21: Introduction to Algorithms by Mohammad Hajiaghayi: In this session, we talk about #DP, #Memoization,#ApproximationAlgorithm, #GreedyAlgorithm, #Backtracking

Paolo Melchiorrepaulox@fosstodon.org
2023-05-30

Iuri de Silvio is presenting the talk "Caching everywhere" at the DjangoCon Europe 2023 in Edinburgh πŸ΄σ §σ ’σ ³σ £σ ΄σ ΏπŸ¦„πŸš€

#DjangoConEuroppe #DjangoCon #Django #Caching #Memoization

CC @djangoconeurope

pretalx.com/djangocon-europe-2

Iuri de Silvio on the stage of the DjangoCon Europe 2023
2022-12-24

Advent of Code Day 24 β€” Blizzard Basin

The Christmas elves don't like the snow for some reason? They have the wrong boss, I think. Well, we better help them get through those couple hundred blizzards.

chasingdings.com/2022/12/24/ad

#AdventofCode #a* #blizzard #elf #memoization #python

A lot of elves running through a snowy valley.
Esparta :ruby:esparta@ruby.social
2022-12-21

A Guide to Memoization in #Ruby, by @appsignal

blog.appsignal.com/2022/12/20/

> 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.

#performance #memoization #caching #optimization

2022-12-20

Advent of Code Day 19 β€” Not Enough Minerals

Okay, this one took a long time. I knew what to do, but what to do was super slow.

chasingdings.com/2022/12/20/ad

#AdventofCode #advent #depthfirstsearch #memoization #python #robots

A woman wearing a Christmas outfit directing mining robots with a handheld device, in a jungle by a lake.
2022-11-29

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.

πŸ‘‰toptal.com/react/react-memoiza

#React #Memoization

Heavy Computation Made Lighter: React Memoization
2021-02-02

- Eager #memoization of functions from infinite types would require infinite storage. But #Haskell is a lazy language, so the boundary between lazily evaluated (infinite) data structures and functions is fuzzy.

Γ†nΓ°r E. Feldstrawaeveltstra
2019-03-07

Of course we could choose to avoid altogether. Avoid . 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 or the .

It can't be achieved on current o.s. kernels or any consumer computer chips.

is an illusion.

Γ†nΓ°r E. Feldstrawaeveltstra
2019-03-07

It's just asking for trouble. It's like asking for a to go in and change a few bits in memory you thought wasn't shared - but you were wrong. Thank you, and .

And it's worse, because you didn't even know that 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, .

Γ†nΓ°r E. Feldstrawaeveltstra
2019-03-07

And the same occurs with any value remembered beyond a very short lifetime, and sometimes even then. (Looking at you, .)
Because a file system is , our suffers the effects of the change. And if the allows for mutability, like 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 does.

Γ†nΓ°r E. Feldstrawaeveltstra
2019-03-07

A file on a file system is a prime example of : 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?

Client Info

Server: https://mastodon.social
Version: 2025.04
Repository: https://github.com/cyevgeniy/lmst