SlideShare a Scribd company logo
Typed Arrays
      Binary Data in the Browser

2012.09.19, 동국대 멀티미디어공학과 이창환
Contents
       Introduction
       Basics of using Typed Arrays
       Browser APIs that use Typed Arrays
       Third-party libraries
       History of Typed Arrays
       Design considerations
       References




    2
Introduction
       The need to have an efficient way to handle binary data in WebGL.

       A slab of memory with a typed view into it
           Like how arrays work in C.
           The JavaScript engine can pass the memory directly to native libraries
           Better than JavaScript arrays for passing data to WebGL and other APIs dealing with
            binary data.


       Typed array views
           Single-type arrays to a segment of an ArrayBuffer.
           Views for all the usual numeric types
               Float32Array, Float64Array, Int32Array and Uint8Array.
           Special view Uint8ClampedArray
               The pixel array type in Canvas's ImageData


       DataView
           Handling heterogeneous data.
           A get/set API to read and write arbitrary data types at arbitrary byte offsets.
           Reading and writing file headers and other such struct-like data.



    3
Introduction

                  JavaScript               Native

Single    Value: 123                     Value: 123
Value    Type: integer


             [0]          Value: 123      [0]:123
             [1]         Type: integer    [1]:123
             [2]                          [2]:123
                          Value: 123
Values       [3]
                         Type: integer    [3]:123
  in         [4]                          [4]:123
             [5]               …          [5]:123
 Array        …                             …
            [n-2]         Value: 123     [n-2]:123
            [n-1]        Type: integer   [n-1]:123


 4
Basics of using Typed Arrays
       Typed array views
       DataView
       A discussion of endianness




    5
Typed Array Views
       To use Typed Arrays
           Create an ArrayBuffer and a view to it




    6
Typed Array Views
       Create an ArrayBuffer and views that point to it.




       Copy a typed array to another typed array
           set() method




    7
DataView
       DataView to the buffer
           To use ArrayBuffers that contain data with
            heterogenous types




           Endian: optional littleEndian parameter




    8
DataView
       Writing values to buffers




    9
A Discussion of Endianness
    Endianness, or byte order
        big-endian: the most significant byte first
        little-endian: the least significant byte first.




    10
Browser APIs that use Typed Arrays
    WebGL
    Canvas 2D
    XMLHttpRequest2
    File APIs
    Transferable objects
    Media Source API
    Binary WebSockets




    11
Third-party libraries
    jDataView
    stringencoding
    BitView.js
    DataStream.js




    12
History of Typed Arrays
    Start in the early implementation stage of WebGL
        JavaScript arrays  Native array
        Allocate a native array
        Fill it by walking over the JavaScript array
        Cast every JavaScript object in the array to the required native type.

    Mozilla's Vladimir Vukicevic
        CanvasFloatArray: a C-style float array with a JavaScript interface

    Renamed WebGLFloatArray

    Renamed Float32Array
        split into a backing ArrayBuffer and the typed Float32Array-view to
         access the buffer.
        Types were added for other integer and floating-point sizes and
         signed/unsigned variants.


    13
Design considerations
    Design of Typed Arrays
        Need to efficiently pass binary data to native libraries.
        The typed array views operate upon aligned data in the host
         CPU’s native endianness.

    DataView
        Designed for file and network I/O

    The design split
        in-memory data assembly (using the typed array views)
        I/O (using DataView)

    Modern JavaScript engines
        Optimize the typed array views heavily
        Achieve high performance on numerical operations

    14
References
    [1] http://www.khronos.org/registry/typedarray/specs/latest/
    [2] https://developer.mozilla.org/en/JavaScript_typed_arrays
    [3] http://blogs.msdn.com/b/ie/archive/2011/12/01/working-
     with-binary-data-using-typed-arrays.aspx
    [4] http://weblog.bocoup.com/javascript-typed-arrays/
    [5] http://blog.n01se.net/?p=248
    [6] http://ie.microsoft.com/testdrive/HTML5/TypedArrays/
    [7] TYPED ARRAYS: BINARY DATA IN THE BROWSER,
     http://www.html5rocks.com/en/tutorials/webgl/typed_arrays/




    15
Ad

More Related Content

What's hot (20)

Sperasoft‬ talks j point 2015
Sperasoft‬ talks j point 2015Sperasoft‬ talks j point 2015
Sperasoft‬ talks j point 2015
Sperasoft
 
Collections - Sorting, Comparing Basics
Collections - Sorting, Comparing Basics Collections - Sorting, Comparing Basics
Collections - Sorting, Comparing Basics
Hitesh-Java
 
Session 15 - Collections - Array List
Session 15 - Collections - Array ListSession 15 - Collections - Array List
Session 15 - Collections - Array List
PawanMM
 
Session 05 - Strings in Java
Session 05 - Strings in JavaSession 05 - Strings in Java
Session 05 - Strings in Java
PawanMM
 
Sysprog 9
Sysprog 9Sysprog 9
Sysprog 9
Ahmed Mekkawy
 
Session 20 - Collections - Maps
Session 20 - Collections - MapsSession 20 - Collections - Maps
Session 20 - Collections - Maps
PawanMM
 
STL in C++
STL in C++STL in C++
STL in C++
Surya Prakash Sahu
 
Java basic datatypes
Java basic datatypesJava basic datatypes
Java basic datatypes
Soba Arjun
 
Standard Template Library
Standard Template LibraryStandard Template Library
Standard Template Library
GauravPatil318
 
Collections - Maps
Collections - Maps Collections - Maps
Collections - Maps
Hitesh-Java
 
Strings in Java
Strings in Java Strings in Java
Strings in Java
Hitesh-Java
 
standard template library(STL) in C++
standard template library(STL) in C++standard template library(STL) in C++
standard template library(STL) in C++
•sreejith •sree
 
An Introduction to the C++ Standard Library
An Introduction to the C++ Standard LibraryAn Introduction to the C++ Standard Library
An Introduction to the C++ Standard Library
Joyjit Choudhury
 
Collections Array list
Collections Array listCollections Array list
Collections Array list
RatnaJava
 
Collections - Array List
Collections - Array List Collections - Array List
Collections - Array List
Hitesh-Java
 
Stl (standard template library)
Stl (standard template library)Stl (standard template library)
Stl (standard template library)
Hemant Jain
 
Collections - Lists, Sets
Collections - Lists, Sets Collections - Lists, Sets
Collections - Lists, Sets
Hitesh-Java
 
Files and data storage
Files and data storageFiles and data storage
Files and data storage
Zaid Shabbir
 
Standard template library
Standard template libraryStandard template library
Standard template library
Jancypriya M
 
Standard Template Library
Standard Template LibraryStandard Template Library
Standard Template Library
Kumar Gaurav
 
Sperasoft‬ talks j point 2015
Sperasoft‬ talks j point 2015Sperasoft‬ talks j point 2015
Sperasoft‬ talks j point 2015
Sperasoft
 
Collections - Sorting, Comparing Basics
Collections - Sorting, Comparing Basics Collections - Sorting, Comparing Basics
Collections - Sorting, Comparing Basics
Hitesh-Java
 
Session 15 - Collections - Array List
Session 15 - Collections - Array ListSession 15 - Collections - Array List
Session 15 - Collections - Array List
PawanMM
 
Session 05 - Strings in Java
Session 05 - Strings in JavaSession 05 - Strings in Java
Session 05 - Strings in Java
PawanMM
 
Session 20 - Collections - Maps
Session 20 - Collections - MapsSession 20 - Collections - Maps
Session 20 - Collections - Maps
PawanMM
 
Java basic datatypes
Java basic datatypesJava basic datatypes
Java basic datatypes
Soba Arjun
 
Standard Template Library
Standard Template LibraryStandard Template Library
Standard Template Library
GauravPatil318
 
Collections - Maps
Collections - Maps Collections - Maps
Collections - Maps
Hitesh-Java
 
Strings in Java
Strings in Java Strings in Java
Strings in Java
Hitesh-Java
 
standard template library(STL) in C++
standard template library(STL) in C++standard template library(STL) in C++
standard template library(STL) in C++
•sreejith •sree
 
An Introduction to the C++ Standard Library
An Introduction to the C++ Standard LibraryAn Introduction to the C++ Standard Library
An Introduction to the C++ Standard Library
Joyjit Choudhury
 
Collections Array list
Collections Array listCollections Array list
Collections Array list
RatnaJava
 
Collections - Array List
Collections - Array List Collections - Array List
Collections - Array List
Hitesh-Java
 
Stl (standard template library)
Stl (standard template library)Stl (standard template library)
Stl (standard template library)
Hemant Jain
 
Collections - Lists, Sets
Collections - Lists, Sets Collections - Lists, Sets
Collections - Lists, Sets
Hitesh-Java
 
Files and data storage
Files and data storageFiles and data storage
Files and data storage
Zaid Shabbir
 
Standard template library
Standard template libraryStandard template library
Standard template library
Jancypriya M
 
Standard Template Library
Standard Template LibraryStandard Template Library
Standard Template Library
Kumar Gaurav
 

Viewers also liked (7)

Web sessions in Developer Conferences
Web sessions in Developer ConferencesWeb sessions in Developer Conferences
Web sessions in Developer Conferences
Changhwan Yi
 
JavaScript Engine and WebAssembly
JavaScript Engine and WebAssemblyJavaScript Engine and WebAssembly
JavaScript Engine and WebAssembly
Changhwan Yi
 
Designing Teams for Emerging Challenges
Designing Teams for Emerging ChallengesDesigning Teams for Emerging Challenges
Designing Teams for Emerging Challenges
Aaron Irizarry
 
UX, ethnography and possibilities: for Libraries, Museums and Archives
UX, ethnography and possibilities: for Libraries, Museums and ArchivesUX, ethnography and possibilities: for Libraries, Museums and Archives
UX, ethnography and possibilities: for Libraries, Museums and Archives
Ned Potter
 
Visual Design with Data
Visual Design with DataVisual Design with Data
Visual Design with Data
Seth Familian
 
3 Things Every Sales Team Needs to Be Thinking About in 2017
3 Things Every Sales Team Needs to Be Thinking About in 20173 Things Every Sales Team Needs to Be Thinking About in 2017
3 Things Every Sales Team Needs to Be Thinking About in 2017
Drift
 
How to Become a Thought Leader in Your Niche
How to Become a Thought Leader in Your NicheHow to Become a Thought Leader in Your Niche
How to Become a Thought Leader in Your Niche
Leslie Samuel
 
Web sessions in Developer Conferences
Web sessions in Developer ConferencesWeb sessions in Developer Conferences
Web sessions in Developer Conferences
Changhwan Yi
 
JavaScript Engine and WebAssembly
JavaScript Engine and WebAssemblyJavaScript Engine and WebAssembly
JavaScript Engine and WebAssembly
Changhwan Yi
 
Designing Teams for Emerging Challenges
Designing Teams for Emerging ChallengesDesigning Teams for Emerging Challenges
Designing Teams for Emerging Challenges
Aaron Irizarry
 
UX, ethnography and possibilities: for Libraries, Museums and Archives
UX, ethnography and possibilities: for Libraries, Museums and ArchivesUX, ethnography and possibilities: for Libraries, Museums and Archives
UX, ethnography and possibilities: for Libraries, Museums and Archives
Ned Potter
 
Visual Design with Data
Visual Design with DataVisual Design with Data
Visual Design with Data
Seth Familian
 
3 Things Every Sales Team Needs to Be Thinking About in 2017
3 Things Every Sales Team Needs to Be Thinking About in 20173 Things Every Sales Team Needs to Be Thinking About in 2017
3 Things Every Sales Team Needs to Be Thinking About in 2017
Drift
 
How to Become a Thought Leader in Your Niche
How to Become a Thought Leader in Your NicheHow to Become a Thought Leader in Your Niche
How to Become a Thought Leader in Your Niche
Leslie Samuel
 
Ad

Similar to W3C HTML5 KIG-Typed Arrays (20)

JavaOne 2013: Memory Efficient Java
JavaOne 2013: Memory Efficient JavaJavaOne 2013: Memory Efficient Java
JavaOne 2013: Memory Efficient Java
Chris Bailey
 
Jgrid
JgridJgrid
Jgrid
Hendrik Ebbers
 
.Net 3.5
.Net 3.5.Net 3.5
.Net 3.5
Pradeep Pajarla
 
Net framework
Net frameworkNet framework
Net framework
Abhishek Mukherjee
 
.Net Framework Introduction
.Net Framework Introduction.Net Framework Introduction
.Net Framework Introduction
Abhishek Sahu
 
File handling
File handlingFile handling
File handling
prateekgemini
 
Introduction to System verilog
Introduction to System verilog Introduction to System verilog
Introduction to System verilog
Pushpa Yakkala
 
Safe Automated Refactoring for Intelligent Parallelization of Java 8 Streams ...
Safe Automated Refactoring for Intelligent Parallelization of Java 8 Streams ...Safe Automated Refactoring for Intelligent Parallelization of Java 8 Streams ...
Safe Automated Refactoring for Intelligent Parallelization of Java 8 Streams ...
Raffi Khatchadourian
 
advancedvlsisystemverilogbychinnifinal-201114060759.pdf
advancedvlsisystemverilogbychinnifinal-201114060759.pdfadvancedvlsisystemverilogbychinnifinal-201114060759.pdf
advancedvlsisystemverilogbychinnifinal-201114060759.pdf
narayanakiran2
 
.Net Classes and Objects | UiPath Community
.Net Classes and Objects | UiPath Community.Net Classes and Objects | UiPath Community
.Net Classes and Objects | UiPath Community
Rohit Radhakrishnan
 
Time Series to Vectors: Leveraging InfluxDB and Milvus for Similarity Search
Time Series to Vectors: Leveraging InfluxDB and Milvus for Similarity SearchTime Series to Vectors: Leveraging InfluxDB and Milvus for Similarity Search
Time Series to Vectors: Leveraging InfluxDB and Milvus for Similarity Search
Zilliz
 
WebGL 2.0 Reference Guide
WebGL 2.0 Reference GuideWebGL 2.0 Reference Guide
WebGL 2.0 Reference Guide
The Khronos Group Inc.
 
Safe Automated Refactoring for Intelligent Parallelization of Java 8 Streams
Safe Automated Refactoring for Intelligent Parallelization of Java 8 StreamsSafe Automated Refactoring for Intelligent Parallelization of Java 8 Streams
Safe Automated Refactoring for Intelligent Parallelization of Java 8 Streams
Raffi Khatchadourian
 
Certification preparation - Net classses and functions.pptx
Certification preparation - Net classses and functions.pptxCertification preparation - Net classses and functions.pptx
Certification preparation - Net classses and functions.pptx
Rohit Radhakrishnan
 
Mongo db Quick Guide
Mongo db Quick GuideMongo db Quick Guide
Mongo db Quick Guide
Sourabh Sahu
 
js.pptx
js.pptxjs.pptx
js.pptx
SuhaibKhan62
 
How Netflix Uses Data Abstraction to Operate Services at Scale - Vidhya Arvin...
How Netflix Uses Data Abstraction to Operate Services at Scale - Vidhya Arvin...How Netflix Uses Data Abstraction to Operate Services at Scale - Vidhya Arvin...
How Netflix Uses Data Abstraction to Operate Services at Scale - Vidhya Arvin...
Nordic APIs
 
Dotnet content
Dotnet contentDotnet content
Dotnet content
maheshcs1
 
Umbraco OktoberFest 2014
Umbraco OktoberFest 2014Umbraco OktoberFest 2014
Umbraco OktoberFest 2014
Jeavon Leopold
 
Aspdot
AspdotAspdot
Aspdot
Nishad Nizarudeen
 
JavaOne 2013: Memory Efficient Java
JavaOne 2013: Memory Efficient JavaJavaOne 2013: Memory Efficient Java
JavaOne 2013: Memory Efficient Java
Chris Bailey
 
.Net Framework Introduction
.Net Framework Introduction.Net Framework Introduction
.Net Framework Introduction
Abhishek Sahu
 
Introduction to System verilog
Introduction to System verilog Introduction to System verilog
Introduction to System verilog
Pushpa Yakkala
 
Safe Automated Refactoring for Intelligent Parallelization of Java 8 Streams ...
Safe Automated Refactoring for Intelligent Parallelization of Java 8 Streams ...Safe Automated Refactoring for Intelligent Parallelization of Java 8 Streams ...
Safe Automated Refactoring for Intelligent Parallelization of Java 8 Streams ...
Raffi Khatchadourian
 
advancedvlsisystemverilogbychinnifinal-201114060759.pdf
advancedvlsisystemverilogbychinnifinal-201114060759.pdfadvancedvlsisystemverilogbychinnifinal-201114060759.pdf
advancedvlsisystemverilogbychinnifinal-201114060759.pdf
narayanakiran2
 
.Net Classes and Objects | UiPath Community
.Net Classes and Objects | UiPath Community.Net Classes and Objects | UiPath Community
.Net Classes and Objects | UiPath Community
Rohit Radhakrishnan
 
Time Series to Vectors: Leveraging InfluxDB and Milvus for Similarity Search
Time Series to Vectors: Leveraging InfluxDB and Milvus for Similarity SearchTime Series to Vectors: Leveraging InfluxDB and Milvus for Similarity Search
Time Series to Vectors: Leveraging InfluxDB and Milvus for Similarity Search
Zilliz
 
Safe Automated Refactoring for Intelligent Parallelization of Java 8 Streams
Safe Automated Refactoring for Intelligent Parallelization of Java 8 StreamsSafe Automated Refactoring for Intelligent Parallelization of Java 8 Streams
Safe Automated Refactoring for Intelligent Parallelization of Java 8 Streams
Raffi Khatchadourian
 
Certification preparation - Net classses and functions.pptx
Certification preparation - Net classses and functions.pptxCertification preparation - Net classses and functions.pptx
Certification preparation - Net classses and functions.pptx
Rohit Radhakrishnan
 
Mongo db Quick Guide
Mongo db Quick GuideMongo db Quick Guide
Mongo db Quick Guide
Sourabh Sahu
 
How Netflix Uses Data Abstraction to Operate Services at Scale - Vidhya Arvin...
How Netflix Uses Data Abstraction to Operate Services at Scale - Vidhya Arvin...How Netflix Uses Data Abstraction to Operate Services at Scale - Vidhya Arvin...
How Netflix Uses Data Abstraction to Operate Services at Scale - Vidhya Arvin...
Nordic APIs
 
Dotnet content
Dotnet contentDotnet content
Dotnet content
maheshcs1
 
Umbraco OktoberFest 2014
Umbraco OktoberFest 2014Umbraco OktoberFest 2014
Umbraco OktoberFest 2014
Jeavon Leopold
 
Ad

More from Changhwan Yi (13)

2013 W3C HTML5 Day Conferences:HTML5 Game App 개발 및 이슈
2013 W3C HTML5 Day Conferences:HTML5 Game App 개발 및 이슈2013 W3C HTML5 Day Conferences:HTML5 Game App 개발 및 이슈
2013 W3C HTML5 Day Conferences:HTML5 Game App 개발 및 이슈
Changhwan Yi
 
Html5 게임 기술의 개요
Html5 게임 기술의 개요Html5 게임 기술의 개요
Html5 게임 기술의 개요
Changhwan Yi
 
동국대 앱창작터 5일차:Cocos2d-X 확장기능
동국대 앱창작터 5일차:Cocos2d-X 확장기능동국대 앱창작터 5일차:Cocos2d-X 확장기능
동국대 앱창작터 5일차:Cocos2d-X 확장기능
Changhwan Yi
 
동국대 앱창작터 4일차:Cocos2d-X 고급기능
동국대 앱창작터 4일차:Cocos2d-X 고급기능동국대 앱창작터 4일차:Cocos2d-X 고급기능
동국대 앱창작터 4일차:Cocos2d-X 고급기능
Changhwan Yi
 
동국대 앱창작터 2일차:Cocos2d-X 기본기능
동국대 앱창작터 2일차:Cocos2d-X 기본기능동국대 앱창작터 2일차:Cocos2d-X 기본기능
동국대 앱창작터 2일차:Cocos2d-X 기본기능
Changhwan Yi
 
동국대 앱창작터 1일차:Cocos2d-X 소개, 환경설정, 주요개념
동국대 앱창작터 1일차:Cocos2d-X 소개, 환경설정, 주요개념동국대 앱창작터 1일차:Cocos2d-X 소개, 환경설정, 주요개념
동국대 앱창작터 1일차:Cocos2d-X 소개, 환경설정, 주요개념
Changhwan Yi
 
W3C HTML5 KIG-The near future of the web platform
 W3C HTML5 KIG-The near future of the web platform W3C HTML5 KIG-The near future of the web platform
W3C HTML5 KIG-The near future of the web platform
Changhwan Yi
 
W3C HTML5 KIG-The complete guide to building html5 games
W3C HTML5 KIG-The complete guide to building html5 gamesW3C HTML5 KIG-The complete guide to building html5 games
W3C HTML5 KIG-The complete guide to building html5 games
Changhwan Yi
 
차세대 웹비즈니스를 위한 "HTML5"
차세대 웹비즈니스를 위한 "HTML5"차세대 웹비즈니스를 위한 "HTML5"
차세대 웹비즈니스를 위한 "HTML5"
Changhwan Yi
 
WoO 2012-Web 서비스 기술
WoO 2012-Web 서비스 기술WoO 2012-Web 서비스 기술
WoO 2012-Web 서비스 기술
Changhwan Yi
 
하이브리드 앱(Hybrid App)
하이브리드 앱(Hybrid App)하이브리드 앱(Hybrid App)
하이브리드 앱(Hybrid App)
Changhwan Yi
 
W3C HTML5 KIG-How to write low garbage real-time javascript
W3C HTML5 KIG-How to write low garbage real-time javascriptW3C HTML5 KIG-How to write low garbage real-time javascript
W3C HTML5 KIG-How to write low garbage real-time javascript
Changhwan Yi
 
W3C HTML5 KIG-HTML5 Game Performance Issue
W3C HTML5 KIG-HTML5 Game Performance IssueW3C HTML5 KIG-HTML5 Game Performance Issue
W3C HTML5 KIG-HTML5 Game Performance Issue
Changhwan Yi
 
2013 W3C HTML5 Day Conferences:HTML5 Game App 개발 및 이슈
2013 W3C HTML5 Day Conferences:HTML5 Game App 개발 및 이슈2013 W3C HTML5 Day Conferences:HTML5 Game App 개발 및 이슈
2013 W3C HTML5 Day Conferences:HTML5 Game App 개발 및 이슈
Changhwan Yi
 
Html5 게임 기술의 개요
Html5 게임 기술의 개요Html5 게임 기술의 개요
Html5 게임 기술의 개요
Changhwan Yi
 
동국대 앱창작터 5일차:Cocos2d-X 확장기능
동국대 앱창작터 5일차:Cocos2d-X 확장기능동국대 앱창작터 5일차:Cocos2d-X 확장기능
동국대 앱창작터 5일차:Cocos2d-X 확장기능
Changhwan Yi
 
동국대 앱창작터 4일차:Cocos2d-X 고급기능
동국대 앱창작터 4일차:Cocos2d-X 고급기능동국대 앱창작터 4일차:Cocos2d-X 고급기능
동국대 앱창작터 4일차:Cocos2d-X 고급기능
Changhwan Yi
 
동국대 앱창작터 2일차:Cocos2d-X 기본기능
동국대 앱창작터 2일차:Cocos2d-X 기본기능동국대 앱창작터 2일차:Cocos2d-X 기본기능
동국대 앱창작터 2일차:Cocos2d-X 기본기능
Changhwan Yi
 
동국대 앱창작터 1일차:Cocos2d-X 소개, 환경설정, 주요개념
동국대 앱창작터 1일차:Cocos2d-X 소개, 환경설정, 주요개념동국대 앱창작터 1일차:Cocos2d-X 소개, 환경설정, 주요개념
동국대 앱창작터 1일차:Cocos2d-X 소개, 환경설정, 주요개념
Changhwan Yi
 
W3C HTML5 KIG-The near future of the web platform
 W3C HTML5 KIG-The near future of the web platform W3C HTML5 KIG-The near future of the web platform
W3C HTML5 KIG-The near future of the web platform
Changhwan Yi
 
W3C HTML5 KIG-The complete guide to building html5 games
W3C HTML5 KIG-The complete guide to building html5 gamesW3C HTML5 KIG-The complete guide to building html5 games
W3C HTML5 KIG-The complete guide to building html5 games
Changhwan Yi
 
차세대 웹비즈니스를 위한 "HTML5"
차세대 웹비즈니스를 위한 "HTML5"차세대 웹비즈니스를 위한 "HTML5"
차세대 웹비즈니스를 위한 "HTML5"
Changhwan Yi
 
WoO 2012-Web 서비스 기술
WoO 2012-Web 서비스 기술WoO 2012-Web 서비스 기술
WoO 2012-Web 서비스 기술
Changhwan Yi
 
하이브리드 앱(Hybrid App)
하이브리드 앱(Hybrid App)하이브리드 앱(Hybrid App)
하이브리드 앱(Hybrid App)
Changhwan Yi
 
W3C HTML5 KIG-How to write low garbage real-time javascript
W3C HTML5 KIG-How to write low garbage real-time javascriptW3C HTML5 KIG-How to write low garbage real-time javascript
W3C HTML5 KIG-How to write low garbage real-time javascript
Changhwan Yi
 
W3C HTML5 KIG-HTML5 Game Performance Issue
W3C HTML5 KIG-HTML5 Game Performance IssueW3C HTML5 KIG-HTML5 Game Performance Issue
W3C HTML5 KIG-HTML5 Game Performance Issue
Changhwan Yi
 

Recently uploaded (20)

Into The Box Conference Keynote Day 1 (ITB2025)
Into The Box Conference Keynote Day 1 (ITB2025)Into The Box Conference Keynote Day 1 (ITB2025)
Into The Box Conference Keynote Day 1 (ITB2025)
Ortus Solutions, Corp
 
How analogue intelligence complements AI
How analogue intelligence complements AIHow analogue intelligence complements AI
How analogue intelligence complements AI
Paul Rowe
 
Quantum Computing Quick Research Guide by Arthur Morgan
Quantum Computing Quick Research Guide by Arthur MorganQuantum Computing Quick Research Guide by Arthur Morgan
Quantum Computing Quick Research Guide by Arthur Morgan
Arthur Morgan
 
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager APIUiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPathCommunity
 
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptxDevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
Justin Reock
 
Complete Guide to Advanced Logistics Management Software in Riyadh.pdf
Complete Guide to Advanced Logistics Management Software in Riyadh.pdfComplete Guide to Advanced Logistics Management Software in Riyadh.pdf
Complete Guide to Advanced Logistics Management Software in Riyadh.pdf
Software Company
 
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
BookNet Canada
 
Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...
Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...
Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...
Impelsys Inc.
 
Linux Support for SMARC: How Toradex Empowers Embedded Developers
Linux Support for SMARC: How Toradex Empowers Embedded DevelopersLinux Support for SMARC: How Toradex Empowers Embedded Developers
Linux Support for SMARC: How Toradex Empowers Embedded Developers
Toradex
 
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc
 
IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...
IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...
IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...
organizerofv
 
Procurement Insights Cost To Value Guide.pptx
Procurement Insights Cost To Value Guide.pptxProcurement Insights Cost To Value Guide.pptx
Procurement Insights Cost To Value Guide.pptx
Jon Hansen
 
ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes Partner Innovation Updates for May 2025ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes
 
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul
 
Electronic_Mail_Attacks-1-35.pdf by xploit
Electronic_Mail_Attacks-1-35.pdf by xploitElectronic_Mail_Attacks-1-35.pdf by xploit
Electronic_Mail_Attacks-1-35.pdf by xploit
niftliyevhuseyn
 
AI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global TrendsAI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global Trends
InData Labs
 
Cyber Awareness overview for 2025 month of security
Cyber Awareness overview for 2025 month of securityCyber Awareness overview for 2025 month of security
Cyber Awareness overview for 2025 month of security
riccardosl1
 
Linux Professional Institute LPIC-1 Exam.pdf
Linux Professional Institute LPIC-1 Exam.pdfLinux Professional Institute LPIC-1 Exam.pdf
Linux Professional Institute LPIC-1 Exam.pdf
RHCSA Guru
 
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptxIncreasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Anoop Ashok
 
Semantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AISemantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AI
artmondano
 
Into The Box Conference Keynote Day 1 (ITB2025)
Into The Box Conference Keynote Day 1 (ITB2025)Into The Box Conference Keynote Day 1 (ITB2025)
Into The Box Conference Keynote Day 1 (ITB2025)
Ortus Solutions, Corp
 
How analogue intelligence complements AI
How analogue intelligence complements AIHow analogue intelligence complements AI
How analogue intelligence complements AI
Paul Rowe
 
Quantum Computing Quick Research Guide by Arthur Morgan
Quantum Computing Quick Research Guide by Arthur MorganQuantum Computing Quick Research Guide by Arthur Morgan
Quantum Computing Quick Research Guide by Arthur Morgan
Arthur Morgan
 
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager APIUiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPathCommunity
 
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptxDevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
Justin Reock
 
Complete Guide to Advanced Logistics Management Software in Riyadh.pdf
Complete Guide to Advanced Logistics Management Software in Riyadh.pdfComplete Guide to Advanced Logistics Management Software in Riyadh.pdf
Complete Guide to Advanced Logistics Management Software in Riyadh.pdf
Software Company
 
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
BookNet Canada
 
Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...
Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...
Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...
Impelsys Inc.
 
Linux Support for SMARC: How Toradex Empowers Embedded Developers
Linux Support for SMARC: How Toradex Empowers Embedded DevelopersLinux Support for SMARC: How Toradex Empowers Embedded Developers
Linux Support for SMARC: How Toradex Empowers Embedded Developers
Toradex
 
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc
 
IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...
IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...
IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...
organizerofv
 
Procurement Insights Cost To Value Guide.pptx
Procurement Insights Cost To Value Guide.pptxProcurement Insights Cost To Value Guide.pptx
Procurement Insights Cost To Value Guide.pptx
Jon Hansen
 
ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes Partner Innovation Updates for May 2025ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes
 
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul
 
Electronic_Mail_Attacks-1-35.pdf by xploit
Electronic_Mail_Attacks-1-35.pdf by xploitElectronic_Mail_Attacks-1-35.pdf by xploit
Electronic_Mail_Attacks-1-35.pdf by xploit
niftliyevhuseyn
 
AI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global TrendsAI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global Trends
InData Labs
 
Cyber Awareness overview for 2025 month of security
Cyber Awareness overview for 2025 month of securityCyber Awareness overview for 2025 month of security
Cyber Awareness overview for 2025 month of security
riccardosl1
 
Linux Professional Institute LPIC-1 Exam.pdf
Linux Professional Institute LPIC-1 Exam.pdfLinux Professional Institute LPIC-1 Exam.pdf
Linux Professional Institute LPIC-1 Exam.pdf
RHCSA Guru
 
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptxIncreasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Anoop Ashok
 
Semantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AISemantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AI
artmondano
 

W3C HTML5 KIG-Typed Arrays

  • 1. Typed Arrays Binary Data in the Browser 2012.09.19, 동국대 멀티미디어공학과 이창환
  • 2. Contents  Introduction  Basics of using Typed Arrays  Browser APIs that use Typed Arrays  Third-party libraries  History of Typed Arrays  Design considerations  References 2
  • 3. Introduction  The need to have an efficient way to handle binary data in WebGL.  A slab of memory with a typed view into it  Like how arrays work in C.  The JavaScript engine can pass the memory directly to native libraries  Better than JavaScript arrays for passing data to WebGL and other APIs dealing with binary data.  Typed array views  Single-type arrays to a segment of an ArrayBuffer.  Views for all the usual numeric types  Float32Array, Float64Array, Int32Array and Uint8Array.  Special view Uint8ClampedArray  The pixel array type in Canvas's ImageData  DataView  Handling heterogeneous data.  A get/set API to read and write arbitrary data types at arbitrary byte offsets.  Reading and writing file headers and other such struct-like data. 3
  • 4. Introduction JavaScript Native Single Value: 123 Value: 123 Value Type: integer [0] Value: 123 [0]:123 [1] Type: integer [1]:123 [2] [2]:123 Value: 123 Values [3] Type: integer [3]:123 in [4] [4]:123 [5] … [5]:123 Array … … [n-2] Value: 123 [n-2]:123 [n-1] Type: integer [n-1]:123 4
  • 5. Basics of using Typed Arrays  Typed array views  DataView  A discussion of endianness 5
  • 6. Typed Array Views  To use Typed Arrays  Create an ArrayBuffer and a view to it 6
  • 7. Typed Array Views  Create an ArrayBuffer and views that point to it.  Copy a typed array to another typed array  set() method 7
  • 8. DataView  DataView to the buffer  To use ArrayBuffers that contain data with heterogenous types  Endian: optional littleEndian parameter 8
  • 9. DataView  Writing values to buffers 9
  • 10. A Discussion of Endianness  Endianness, or byte order  big-endian: the most significant byte first  little-endian: the least significant byte first. 10
  • 11. Browser APIs that use Typed Arrays  WebGL  Canvas 2D  XMLHttpRequest2  File APIs  Transferable objects  Media Source API  Binary WebSockets 11
  • 12. Third-party libraries  jDataView  stringencoding  BitView.js  DataStream.js 12
  • 13. History of Typed Arrays  Start in the early implementation stage of WebGL  JavaScript arrays  Native array  Allocate a native array  Fill it by walking over the JavaScript array  Cast every JavaScript object in the array to the required native type.  Mozilla's Vladimir Vukicevic  CanvasFloatArray: a C-style float array with a JavaScript interface  Renamed WebGLFloatArray  Renamed Float32Array  split into a backing ArrayBuffer and the typed Float32Array-view to access the buffer.  Types were added for other integer and floating-point sizes and signed/unsigned variants. 13
  • 14. Design considerations  Design of Typed Arrays  Need to efficiently pass binary data to native libraries.  The typed array views operate upon aligned data in the host CPU’s native endianness.  DataView  Designed for file and network I/O  The design split  in-memory data assembly (using the typed array views)  I/O (using DataView)  Modern JavaScript engines  Optimize the typed array views heavily  Achieve high performance on numerical operations 14
  • 15. References  [1] http://www.khronos.org/registry/typedarray/specs/latest/  [2] https://developer.mozilla.org/en/JavaScript_typed_arrays  [3] http://blogs.msdn.com/b/ie/archive/2011/12/01/working- with-binary-data-using-typed-arrays.aspx  [4] http://weblog.bocoup.com/javascript-typed-arrays/  [5] http://blog.n01se.net/?p=248  [6] http://ie.microsoft.com/testdrive/HTML5/TypedArrays/  [7] TYPED ARRAYS: BINARY DATA IN THE BROWSER, http://www.html5rocks.com/en/tutorials/webgl/typed_arrays/ 15