😱 "เขียนโค้ดยังไงให้ทำงานเหมือนเดิม...แต่เร็วขึ้นกว่าเดิม?" วันนี้แอดจะพาไปไขความลับกับการโค้ดโดยอาศัยหลัก Locality กันครับ
.
⭐️ Locality หรือ Locality of Reference คือหลักการทำงานที่โปรแกรมเรียกหาข้อมูลที่ตำแหน่งเดิมหรือใกล้เคียงกับตำแหน่งเดิม ซึ่งเกิดขึ้นได้บ่อยจากการทำงาน ยกตัวอย่างเช่น การวน Loop
.
ซึ่ง Cache ได้นำเอาหลักการนี้มาใช้ในการช่วยโหลดและเก็บข้อมูล เพื่อช่วยแก้ปัญหาที่บรรจุข้อมูลได้น้อย
.
และอย่างที่หลายคนน่าจะรู้ว่าเมื่อโปรแกรมต้องการข้อมูล จะเริ่มต้นหาจากใน Cache เพื่อความรวดเร็วในการทำงาน
.
ดังนั้นหากเราเขียนโค้ดให้เรียกหาข้อมูลที่ใกล้กันกับข้อมูลก่อนหน้าก็จะช่วยให้โปรแกรมทำงานได้เร็วขึ้นนั่นเอง
.
มาถึงตรงนี้อาจจะสงสัยกันว่า "เอ๊ะ! แค่วนลูปไม่กี่รอบมันจะช่วยให้เร็วขึ้นขนาดนั้นเลยเหรอ?"
.
ลองนึกภาพโปรแกรมใหญ่ ๆ ที่มีข้อมูลเป็นหมื่น ๆ Record ดูสิครับว่าต้องวนดึงข้อมูลกี่รอบ...เริ่มเยอะแล้วใช่มั้ยครับ?
.
นั่นแหละครับเลยเป็นเหตุผลว่าทำไม Locality ถึงเป็นอีกหนึ่งกุญแจที่ใช้ในการไขความลับ ปลดล็อคความเร็วในการทำงานให้กับโปรแกรม
.
เรียกได้ว่าเป็นจุดเล็ก ๆ ที่หลายคนอาจจะมองข้ามไป รู้อย่างงี้แล้วอย่าลืมลองกลับไปทำกันดูนะครับ
.
ซึ่งถ้าใครอยากอ่านข้อมูลเพิ่มเติมสามารถเข้าไปอ่านได้ที่ >>> http://bit.ly/locality-medium
.
ขอขอบคุณเจ้าของบทความดีดีแบบนี้ด้วยนะครับ 🙏😁
.
#BorntoDev - 🦖 Coding Academy ให้การพัฒนาเทคโนโลยีเป็นเรื่องง่ายสำหรับทุกคน
同時也有1部Youtube影片,追蹤數超過9萬的網紅Smart Travel,也在其Youtube影片中提到,請用片右下角調HD1080高清睇片。 (文:WIKIPEDIA) 達令港(Darling Harbour)是毗鄰悉尼市中心的一個海港。這也是一個大型娛樂和行人專用區,坐落在悉尼中央商務區的西郊。當地距離唐人街向北延伸,到國王街碼頭在東部,和皮爾蒙特西部郊區的柯克灣兩旁。柯克灣,使達令港,向北進入...
「locality of reference」的推薦目錄:
- 關於locality of reference 在 BorntoDev Facebook
- 關於locality of reference 在 BorntoDev Facebook
- 關於locality of reference 在 Smart Travel Youtube
- 關於locality of reference 在 L-3.11: Locality of Reference in Cache Memory - YouTube 的評價
- 關於locality of reference 在 temporal locality of reference | Cache memory, Computer ... 的評價
locality of reference 在 BorntoDev Facebook 八卦
😱 "เขียนโค้ดยังไงให้ทำงานเหมือนเดิม...แต่เร็วขึ้นกว่าเดิม?" วันนี้แอดจะพาไปไขความลับกับการโค้ดโดยอาศัยหลัก Locality กันครับ
.
⭐️ Locality หรือ Locality of Reference คือหลักการทำงานที่โปรแกรมเรียกหาข้อมูลที่ตำแหน่งเดิมหรือใกล้เคียงกับตำแหน่งเดิม ซึ่งเกิดขึ้นได้บ่อยจากการทำงาน ยกตัวอย่างเช่น การวน Loop
.
ซึ่ง Cache ได้นำเอาหลักการนี้มาใช้ในการช่วยโหลดและเก็บข้อมูล เพื่อช่วยแก้ปัญหาที่บรรจุข้อมูลได้น้อย...
See More
locality of reference 在 Smart Travel Youtube 的評價
請用片右下角調HD1080高清睇片。
(文:WIKIPEDIA)
達令港(Darling Harbour)是毗鄰悉尼市中心的一個海港。這也是一個大型娛樂和行人專用區,坐落在悉尼中央商務區的西郊。當地距離唐人街向北延伸,到國王街碼頭在東部,和皮爾蒙特西部郊區的柯克灣兩旁。柯克灣,使達令港,向北進入打開大得多的傑克遜港的水道之一。
達令港(Darling Harbour)被命名為中將拉爾夫·親愛的,誰是新南威爾士州州長, 1825年至1831年之後。它最初是商業港口,包括悉尼的達令港(Darling Harbour)鐵路貨場的一部分。在大蕭條期間,東部的達令港(Darling Harbour) ( Barangaroo項目)成為被稱為飢餓大道,參考水邊的工人尋找工作沿著碼頭。
大部分土地已新南威爾士州鐵路中央編組站和貨運整合中心的網站。查詢到新南威爾士州交通運輸行業,包括鐵路/公路的競爭, ( 1978-80 )根據專員GAVAN麥克多內爾,發現,該中心是低效的,應該被感動,並用於其他公共用途的土地。這些建議採取行動時,由20世紀80年代中期到後期時,該地區已成為在很大程度上被遺棄它是重建公共工程的一項倡議,當時的新南威爾士州部長一行人和旅遊管理區,勞麗布里爾頓。達令港的悉尼會展中心是舉辦2000年夏季奧運會和2007年APEC澳大利亞的一個關鍵會議場地。
Darling Harbour is a harbour adjacent to the city centre of Sydney. It is also a large recreational and pedestrian precinct that is situated on western outskirts of the Sydney central business district. The locality extends northwards from Chinatown, along both sides of Cockle Bay to King Street Wharf on the east, and to the suburb of Pyrmont on the west. Cockle Bay is just one of the waterways that makes up Darling Harbour, which opens north into the much larger Port Jackson.
Darling Harbour is named after Lieutenant-General Ralph Darling, who was Governor of New South Wales from 1825 to 1831. It was originally part of the commercial port of Sydney, including the Darling Harbour Railway Goods Yard. During the Great Depression, the eastern part of Darling Harbour (Barangaroo) became known as The Hungry Mile, a reference to the waterside workers searching for jobs along the wharves.
Much of the land had been the site of the NSW Railways central marshalling yards and freight consolidation centre. The Enquiry into the NSW transport industry, including rail/road competition, (1978--80) under Commissioner Gavan McDonell, found that this centre was inefficient, should be moved, and the land used for other public purposes. These recommendations were acted upon and by the mid-to-late 1980s, when the area had become largely derelict it was redeveloped as a pedestrian and tourist precinct as an initiative of then New South Wales Minister for Public Works, Laurie Brereton. The Sydney Convention and Exhibition Centre at Darling Harbour was a venue of the 2000 Summer Olympic Games and a key meeting venue of APEC Australia 2007.

locality of reference 在 temporal locality of reference | Cache memory, Computer ... 的八卦
Jun 6, 2021 - Cache hit ratio and types of cache memories in OS. The role of cache memory between CPU and RAM in computer organization and architecture. ... <看更多>
locality of reference 在 L-3.11: Locality of Reference in Cache Memory - YouTube 的八卦
Subscribe to our new channel:https://www.youtube.com/@varunainashots Locality of reference, is the tendency of a processor to access the ... ... <看更多>