aboutsummaryrefslogtreecommitdiff
path: root/content/posts/2024-01-26-data-oriented-design.smd
diff options
context:
space:
mode:
authorMartin Ashby <martin@ashbysoft.com>2024-12-21 22:18:18 +0000
committerMartin Ashby <martin@ashbysoft.com>2024-12-21 22:18:18 +0000
commit82e7ac75954c973a5c59a02684788c0fb26e14dd (patch)
treea1b09939f30bc4c232e69f980c2a47e48625ee1d /content/posts/2024-01-26-data-oriented-design.smd
parentff323f79e03174e4cdf2a709c095ff83e7ea3669 (diff)
downloadmfashby.net-82e7ac75954c973a5c59a02684788c0fb26e14dd.tar.gz
mfashby.net-82e7ac75954c973a5c59a02684788c0fb26e14dd.tar.bz2
mfashby.net-82e7ac75954c973a5c59a02684788c0fb26e14dd.tar.xz
mfashby.net-82e7ac75954c973a5c59a02684788c0fb26e14dd.zip
Bump zine 0.3.0 -> 0.8.0
Fix a lot of associated breakage Fix broken rss.xml file as highlighted to me by Matthijs van der Wild (thanks!)
Diffstat (limited to 'content/posts/2024-01-26-data-oriented-design.smd')
-rw-r--r--content/posts/2024-01-26-data-oriented-design.smd17
1 files changed, 17 insertions, 0 deletions
diff --git a/content/posts/2024-01-26-data-oriented-design.smd b/content/posts/2024-01-26-data-oriented-design.smd
new file mode 100644
index 0000000..0b16419
--- /dev/null
+++ b/content/posts/2024-01-26-data-oriented-design.smd
@@ -0,0 +1,17 @@
+---
+.title = "Book - Data Oriented Design",
+.author = "Martin Ashby",
+.date = @date("2024-01-26T20:19:31Z"),
+.layout = "single.shtml",
+.custom = {"comments": true},
+---
+
+I recently read [Data Oriented Design](https://www.dataorienteddesign.com/dodbook/) by Richard Fabian.
+
+The book is about software design; and specifically it relates to software design in games, but the principals are partially relevant to other domains as well.
+
+The main take away seems to be that 'Object Oriented Design' fails to deliver on some of the properties that software engineers think it will give their projects, as well as being hurtful for performance in general due to it's inherent incompatibility with how modern CPUs work. The remedy is 'Data Oriented Design' which advocates _separating_ data from behaviour, normalizing your data in the same way that you would in a relational database system, and processing in bulk rather than jumping back and forth between tasks.
+
+There were some paragraphs on _why_ object oriented programming is bad for performance; and the answer is that it's bad for pipelining and branch prediction, mainly becuase of C++ virtual functions which branch and then have to do pointer lookups in order to find which code to execute, which means pipelining is ineffective. The same problem exists in theory in other programming languages which use inheritance.
+
+Although it was an interesting read, I don't think it'll have much impact on how I think about software that I work on. At my company we are working on a web application which does not have the same stringent low-level performance requirements as video games do. We also use an external relational database rather than having local application state, and code we write uses a minimum amount of local state. There were some interesting points about database normal forms and how they are useful for extensibility which are relevant to me, and I'll be taking those on board. In future my work might involve more data processing, where performance is more of a concern, so I might end up revisiting this book. \ No newline at end of file