Skip to contentSkip to conversation

datastruct: Remove outdated content

PATCH Superseded Alan Huang 2 participants 3 messages May 8, 2023 – May 9, 2023

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Alan Huang

author
#0 lore raw

PATCH 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:

	2ea492b,
	2a7f20d,
	  ...

So, the patch removes the outdated content.

---
 datastruct/datastruct.tex | 23 -----------------------
 1 file changed, 23 deletions(-)
datastruct/datastruct.tex +0 -23
index 8c2bfc16..9aa04bb5 100644
@@ -2017,28 +2017,6 @@ 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{
 	How much do these specializations really save?
 	Are they really worth it?
@@ -2052,7 +2030,6 @@ the subsequent call to \co{ht_get_bucket()}.
 	Some use cases are extremely sensitive to performance and
 	scalability, while others are less so.
 }\QuickQuizEndE
-}
 
 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
Reviewed-by on v1 1/1
#1 lore raw

Hi Alan,

Quoted 6 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:

	2ea492b,
	2a7f20d,
	  ...

Can you say (as recommended in patches to Linux kernel) ?:

2ea492bbab9d ("datatruct/hash: Don't recompute hashes in hashtab_add()") 2a7f20d234e7 ("datastruct/hash: Don't recompute hashes in hashtab_del()")

(hashes of 7 chars should be sufficient for perfbook, but our eyes expect 12 chars ...)

Quoted 1 line

So, the patch removes the outdated content.

Indeed.

However, -nq builds need additional tweaks appended below (on top). Can you do a respin with my Rb tag.

See qqz.sty's header comment for the format of consecutive QQz's.

Thanks, Akira

datastruct/datastruct.tex +3 -3
index 9aa04bb5db2e..0242ccc7ba4b 100644
@@ -2017,10 +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.
 
-\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
@@ -2029,7 +2029,7 @@ argument marshalling as well.
 	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
author
#2 lore raw

Hi Akira,

Thank you for your review and suggestions!

I have sent patch v2.

Thanks,
Alan

Quoted 60 lines

2023年5月9日 08:05,Akira Yokosawa <[email protected]> 写道:

Hi Alan,

Quoted 6 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:
2ea492b,
2a7f20d,
...

Can you say (as recommended in patches to Linux kernel) ?:

2ea492bbab9d ("datatruct/hash: Don't recompute hashes in hashtab_add()") 2a7f20d234e7 ("datastruct/hash: Don't recompute hashes in hashtab_del()")

(hashes of 7 chars should be sufficient for perfbook, but our eyes expect 12 chars ...)

Quoted 1 line

So, the patch removes the outdated content.

Indeed.

However, -nq builds need additional tweaks appended below (on top). Can you do a respin with my Rb tag.

See qqz.sty's header comment for the format of consecutive QQz's.

Thanks, Akira

datastruct/datastruct.tex +0 -0
index 9aa04bb5db2e..0242ccc7ba4b 100644
@@ -2017,10 +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.

-\QuickQuizE{
+\QuickQuiz{
How much do these specializations really save?
Are they really worth it?

datastruct/datastruct.tex +1 -1
-}\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

datastruct/datastruct.tex +0 -0
@@ -2029,7 +2029,7 @@ argument marshalling as well.

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.

datastruct/datastruct.tex +1 -1
-}\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