this post was submitted on 21 Feb 2024
1 points (100.0% liked)

General Programming Discussion

7814 readers
1 users here now

A general programming discussion community.

Rules:

  1. Be civil.
  2. Please start discussions that spark conversation

Other communities

Systems

Functional Programming

Also related

founded 5 years ago
MODERATORS
top 2 comments
sorted by: hot top controversial new old
[โ€“] [email protected] 0 points 8 months ago

This one class I took in college presented a problem with a custom puzzle that involved closing loops on points laid out in a checkerboard pattern. If you implemented your solution using Lisp, you got a letter grade bonus, where otherwise the only criterion for your score was the performance of your solution.

I'm reminded of this problem I faced years ago because having a compact representation that is useful was key to extracting maximum performance.

Ultimately, I hand coded in x86 SIMD instructions to solve many instances of the problem in parallel, packing about eight problem instances into one register. It was the highest performing solution in the class and it both angered and disappointed the professor.

A useful, compact representation is key to efficiently solving many problems.

[โ€“] [email protected] 0 points 8 months ago

OP here! People are rightfully pointing out that this can be compressed further.

My challenge to you: Implement a compressed representation along with the get_cell and set_cell methods, without resorting to lookup tables!

Also, check out Alejandra's blog at https://goose.love/!

(And yeah, you need 12 or 13 bits, not 10, if you don't want to eliminate symmetries.)