Skip to contentSkip to conversation

datastruct: Remove outdated content

PATCH In review Alan Huang 2 participants 2 messages May 9, 2023

lore
Share & tools
lore

Alan Huang

author
#0 lore raw

PATCH v2 1/1 datastruct: Remove outdated content

The code of resizable hash table has been updated so that it doesn't need to compute the hash twice since 2019. Here are some related commits:
2ea492bbab9d ("datatruct/hash: Don't recompute hashes in hashtab_add()") 2a7f20d234e7 ("datastruct/hash: Don't recompute hashes in hashtab_del()")
...
So, the patch removes the outdated content.

---
 datastruct/datastruct.tex | 29 +++--------------------------
 1 file changed, 3 insertions(+), 26 deletions(-)
datastruct/datastruct.tex +3 -26
index 8c2bfc16..0242ccc7 100644
@@ -2017,32 +2017,10 @@ which could allow the compiler to inline the resulting fixed functions,
 eliminating not only the overhead of the call instruction, but the
 argument marshalling as well.
 
-In addition, the resizable hash table is designed to fit an API
-that segregates bucket selection from concurrency control.
-Although this allows a single torture test to exercise all the hash-table
-implementations in this chapter, it also means that many operations
-must compute the hash and interact with possible resize operations twice
-rather than just once.
-In a performance-conscious environment, the \co{hashtab_lock_mod()}
-function would also return a reference to the bucket selected, eliminating
-the subsequent call to \co{ht_get_bucket()}.
-
-\QuickQuizSeries{%
-\QuickQuizB{
-	Couldn't the \path{hashtorture.h} code be modified to accommodate
-	a version of \co{hashtab_lock_mod()} that subsumes the
-	\co{ht_get_bucket()} functionality?
-}\QuickQuizAnswerB{
-	It probably could, and doing so would benefit all of the
-	per-bucket-locked hash tables presented in this chapter.
-	Making this modification is left as an exercise for the
-	reader.
-}\QuickQuizEndB
-%
-\QuickQuizE{
+\QuickQuiz{
 	How much do these specializations really save?
 	Are they really worth it?
-}\QuickQuizAnswerE{
+}\QuickQuizAnswer{
 	The answer to the first question is left as an exercise to
 	the reader.
 	Try specializing the resizable hash table and see how much
@@ -2051,8 +2029,7 @@ the subsequent call to \co{ht_get_bucket()}.
 	instead be answered with respect to a specific use case.
 	Some use cases are extremely sensitive to performance and
 	scalability, while others are less so.
-}\QuickQuizEndE
-}
+}\QuickQuizEnd
 
 All that aside, one of the great benefits of modern hardware compared
 to that available when I first started learning to program back in
Signature · 1 line
2.34.1
#1 lore raw
Quoted 10 lines · Alan Huang

The code of resizable hash table has been updated so that it doesn't need to compute the hash twice since 2019. Here are some related commits:
2ea492bbab9d ("datatruct/hash: Don't recompute hashes in hashtab_add()") 2a7f20d234e7 ("datastruct/hash: Don't recompute hashes in hashtab_del()")
...
So, the patch removes the outdated content.

Good catch! Queued and pushed, thank you both!

Thanx, Paul

Quoted 56 lines
---
 datastruct/datastruct.tex | 29 +++--------------------------
 1 file changed, 3 insertions(+), 26 deletions(-)
datastruct/datastruct.tex +3 -26
index 8c2bfc16..0242ccc7 100644
@@ -2017,32 +2017,10 @@ which could allow the compiler to inline the resulting fixed functions,
 eliminating not only the overhead of the call instruction, but the
 argument marshalling as well.
 
-In addition, the resizable hash table is designed to fit an API
-that segregates bucket selection from concurrency control.
-Although this allows a single torture test to exercise all the hash-table
-implementations in this chapter, it also means that many operations
-must compute the hash and interact with possible resize operations twice
-rather than just once.
-In a performance-conscious environment, the \co{hashtab_lock_mod()}
-function would also return a reference to the bucket selected, eliminating
-the subsequent call to \co{ht_get_bucket()}.
-
-\QuickQuizSeries{%
-\QuickQuizB{
-	Couldn't the \path{hashtorture.h} code be modified to accommodate
-	a version of \co{hashtab_lock_mod()} that subsumes the
-	\co{ht_get_bucket()} functionality?
-}\QuickQuizAnswerB{
-	It probably could, and doing so would benefit all of the
-	per-bucket-locked hash tables presented in this chapter.
-	Making this modification is left as an exercise for the
-	reader.
-}\QuickQuizEndB
-%
-\QuickQuizE{
+\QuickQuiz{
 	How much do these specializations really save?
 	Are they really worth it?
-}\QuickQuizAnswerE{
+}\QuickQuizAnswer{
 	The answer to the first question is left as an exercise to
 	the reader.
 	Try specializing the resizable hash table and see how much
@@ -2051,8 +2029,7 @@ the subsequent call to \co{ht_get_bucket()}.
 	instead be answered with respect to a specific use case.
 	Some use cases are extremely sensitive to performance and
 	scalability, while others are less so.
-}\QuickQuizEndE
-}
+}\QuickQuizEnd
 
 All that aside, one of the great benefits of modern hardware compared
 to that available when I first started learning to program back in
Signature · 1 line
2.34.1