投稿時間:2023-07-29 19:07:21 RSSフィード2023-07-29 19:00 分まとめ(12件)

カテゴリー等 サイト名等 記事タイトル・トレンドワード等 リンクURL 頻出ワード・要約等/検索ボリューム 登録日
python Pythonタグが付けられた新着投稿 - Qiita Python3ではじめるシステムトレード:非復元抽出 https://qiita.com/innovation1005/items/2146e6b90a21d250c293 標本調査 2023-07-29 18:28:45
js JavaScriptタグが付けられた新着投稿 - Qiita React関数命名:「on」と「handle」の理解と適切な使い方 https://qiita.com/itinerant_programmer/items/0d5303394da8e6c5310b handle 2023-07-29 18:03:05
js JavaScriptタグが付けられた新着投稿 - Qiita 【読み物】StandFM #032(後編) より「MINT体験は、特別なもの。2071年に思いを込めたNFT」 https://qiita.com/Rekt-Order/items/d244128ce797b79a525c nftarttokyo 2023-07-29 18:00:26
AWS AWSタグが付けられた新着投稿 - Qiita AWS Public IPv4 Address有償化に向けて、全AWSアカウントの公開IP一覧を出す https://qiita.com/yoshi-taka/items/b4a6ab001e5670222c30 awsconfigadvancedq 2023-07-29 18:54:38
Azure Azureタグが付けられた新着投稿 - Qiita Azure Pipelines 内から Azure CLI でプルリクを作ってみた https://qiita.com/mnrst/items/cb3b5eaf86bcdb5a6461 azurecli 2023-07-29 18:00:20
技術ブログ Developers.IO RDS for SQL ServerでKerberos認証を使う条件について https://dev.classmethod.jp/articles/rds-for-sql-server-kerberos-authentication/ activedirectory 2023-07-29 09:22:15
海外TECH DEV Community Secret of Typia, how it could be 20,000x faster validator - Hidden Class Optimization of v8 engine https://dev.to/samchon/secret-of-typia-how-it-could-be-20000x-faster-validator-hidden-class-optimization-in-v8-engine-1mfb Secret of Typia how it could be x faster validator Hidden Class Optimization of v engine Preface RUNTIME VALIDATORSexport function is lt T gt input unknown T input is T returns booleanexport function assert lt T gt input unknown T T throws TypeGuardErrorexport function validate lt T gt input unknown T IValidation lt T gt detailedexport const customValidators CustomValidatorMap customizable ENHANCED JSONexport function application lt Args gt IJsonApplication JSON schemaexport function assertParse lt T gt input string T type safe parserexport function assertStringify lt T gt input T string safe and faster isParse validateParse stringify isStringify validateStringify RANDOM DATA GENERATORexport function random lt T gt g Partial lt IRandomGenerator gt Primitive lt T gt Let s study why typia is much faster than class validator Github Repository Guide Documents I ve written some articles introducing my TypeScript runtime validator library typia in here dev to community In these previous articles I had often explained that typia boosts up validation spped through AoT Ahead of Time compliation and it is maximum x faster than class validator By the way describing the AoT compilation I d just told that typia generates static validation code for target T type and such static code makes program faster I never had not explained the reason why such static validation codes are much faster than dynamic validation codes of class validator In today I ll describe the reason why TYPESCRIPT SOURCE CODEtypia is lt number gt typia createIs lt Date gt COMPILED JAVASCRIPT CODE input gt number typeof input input gt input instanceof Date Measured on Surface Pro Every objects are HashMapTo aid your understanding I will use many figurative expressions and pseudo codes However these figurative expressions and pseudo codes may be somewhat different from actual computer engineering theories Please read this article considering such aspects Have you heard that every objects in dynamic languages are HashMap To know how typia optimizes the performance you ve to understand this concept Why dynamic languages are using HashMap and how the HashMap makes program slower in dynamic language like JavaScript const obj you can any properties at any timeobj a A obj wafdfaf obj RandomGenerator string true removing properties are also samedelete obj a delete obj wafdfaf At first JavaScript is a dynamic language So it is possible to assign any type of value to a variable In the object case it is even possible to add or delete properties at any time To support dynamic properties insertions and deletions the object must be implemented as a HashMap type It s the reason why dynamic languages are using HashMap for objects and there s no any exception case in the dynamic languages Python Ruby PHP and so on all of them are using HashMap for objects HashMap classexport class HashMap lt Key T gt private hasher key Key gt number private equal x Key y Key gt number HashMap stores its key value pairs into a Linked List private data List lt Entry lt Key T gt gt Instead have bucket array of linked list nodes for fast key finding private buckets List Node lt Entry lt Key T gt gt private find key Key List Node lt Entry lt Key T gt gt const hash number this hasher key const index number hash this buckets length const bucket List Node lt Entry lt Key T gt gt this buckets index return bucket find node gt this equal node value key key this data end Therefore single key access could be faster public has key Key boolean this find key this data end public get key Key T undefined const it List Node lt Entry lt Key T gt gt this find key return it this data end it value value undefined However full iteration is slower as well as linked list public entries callback value Key T gt void void let it List Node lt Entry lt Key T gt gt this data begin while it this data end callback it value key it value value it it next public size number return this data size export class List lt T gt private begin List lt T gt private end List lt T gt private size number public size number public begin List Node lt T gt public end List Node lt T gt export namespace List export class Node lt T gt public next Node lt T gt null public prev Node lt T gt null public value T Actual codes HashMap HashBuckets By the way you know how to implement the HashMap HashMap stores its key value pairs into a Linked List doubly linked list in C STL case Also for the fast key finding it stores nodes of Linked List into an Bucket array This is the reason why HashMap makes dynamic languages slower As you know static languages are containing object properties into a fixed and sequenced memory space like an Array Comparing iteration speed of Linked List versus Array which one is faster Of course Array is much faster This is the one of principle reason why dynamic languages are slower than static languages Dynamic languages store properties into Linked ListStatic languages store properties into Array sequenced memory space If my explanation is not easy to understand read above pseudo codes It s not the actual implementation of HashMap and Linked List but would be helpful to understand the concept Hidden Class OptimizationNow we ve learned that dynamic languages are utilizing HashMap for dynamic key composition but it makes program slower because of its storage Linked List By the way v engine has a special optimization technique for this problem When v engine detects an object type that has fixed properties composition it makes a hidden class definition for the object type And the hidden class definition is not using HashMap but arrange properties into a fixed and sequenced memory space like static languages This is called Hidden Class Optimization If you ve heard that Google Chrome or NodeJS are much faster than other dynamic or some static languages like Java it s OK to assume that the hidden class optimization is one of the main reason ConclusionLet s summarize up what we ve learned in here article Dynamic languages are using HashMap to support dynamic properties insertions and deletions HashMap stores its key value pairs into a Linked List container and it makes rpgoram slowerBesides static languages are storing properties into a fixed and sequenced memory space like an Array and it makes program fasterIn the v engine case it has a special optimization technique called Hidden Class Optimization to escape from the HashMap and store properties into a fixed and sequenced memory space like static languagesThe reason why typia is faster than class validator is also not much different from the theoretical content summarized above I ve designed typia to generate code that favors the v engine and in actually code generated by typia benefits from the hidden class optimization Besides class validator and class transform are always composing its serialization and validation logics through dynamic properties accessments especially represented by Reflect Therefore class validator and class transform never can get benefit from the hidden class optimization and always iterating the slow Linked List nodes The x speed gap also came from such difference Typically the traversal speed of an array and a linked list differs by about a factor of As class validator and class transformer have dual to quadruple nested iterations about dynamic key accessing the x gap be powered to maximum x in theorically 2023-07-29 09:41:47
海外TECH DEV Community Still confused on how to get started in open source? https://dev.to/wonuola_w/still-confused-on-how-to-get-started-in-open-source-28de Still confused on how to get started in open source Listen to this insightful episode with Toby solutions on Tech with Wonuola the podcast 2023-07-29 09:32:58
海外科学 NYT > Science ‘A Dangerous Combination’: Teenagers’ Accidents Expose E-Bike Risks https://www.nytimes.com/2023/07/29/health/ebikes-safety-teens.html industry 2023-07-29 09:00:53
海外科学 NYT > Science What Is an E-Bike, and How Safe Are They? https://www.nytimes.com/2023/07/29/health/ebikes-safety-regulation.html popular 2023-07-29 09:00:31
ニュース BBC News - Home KyivPride: Thousands to march in Ukraine Pride in Liverpool https://www.bbc.co.uk/news/uk-england-merseyside-66340307?at_medium=RSS&at_campaign=KARANGA eurovision 2023-07-29 09:54:33
ニュース BBC News - Home Sweden 5-0 Italy: Arsenal's Amanda Ilestedt scores two goals in easy win https://www.bbc.co.uk/sport/football/66347280?at_medium=RSS&at_campaign=KARANGA Sweden Italy Arsenal x s Amanda Ilestedt scores two goals in easy winSweden turn on the style to demolish Group G rivals Italy and secure a place in the last of the Women s World Cup with one game to spare 2023-07-29 09:43:32

コメント

このブログの人気の投稿

投稿時間:2021-06-17 22:08:45 RSSフィード2021-06-17 22:00 分まとめ(2089件)

投稿時間:2021-06-20 02:06:12 RSSフィード2021-06-20 02:00 分まとめ(3871件)

投稿時間:2021-06-17 05:05:34 RSSフィード2021-06-17 05:00 分まとめ(1274件)