This document discusses data efficiency on the BEAM virtual machine. It describes the representation of various data types in memory, including BEAM files, terms, lists, binaries, tuples, maps, and external term format. It provides tips on choosing efficient data structures and avoiding inefficient operations. Profiling and measuring memory usage is recommended to understand one's specific data.
Efficient Erlang - Performance and memory efficiency of your data by Dmytro L...Erlang Solutions
This document discusses various ways to improve memory and performance efficiency in Erlang programs. It covers the memory usage and performance characteristics of common Erlang data types like literals, immediates, boxed values, lists, tuples, binaries, ETS, and functions. Some key points include: literals and immediates have very low memory overhead; lists have efficient prepend but inefficient append; tuples have good locality but copying is expensive; binaries have reference counting for large values; ETS implies data copying; and external term format is CPU intensive for encoding. The document provides advice on optimizing for these behaviors.
Understanding the components of standard template libraryRahul Sharma
The document discusses the components of the Standard Template Library in C++, which are containers, algorithms, and iterators. Containers store data in memory in an organized way. Algorithms are procedures that process data contained in containers. Iterators are objects like pointers that point to elements in containers, connecting algorithms to containers and playing a key role in manipulating data.
This is an intermediate conversion course for C++, suitable for second year computing students who may have learned Java or another language in first year.
Data structure and algorithm using javaNarayan Sau
This presentation created for people who like to go back to basics of data structure and its implementation. This presentation mostly helps B.Tech , Bsc Computer science students as well as all programmer who wants to develop software in core areas.
The document provides information about data structures and algorithms. It defines key terms like data, information, data structure, algorithm and different types of algorithms. It discusses linear data structures like arrays, operations on arrays like traversing, searching, inserting and deleting elements. It also covers recursive functions, recursion concept, searching algorithms like sequential search and binary search along with their algorithms and examples.
The document provides coding conventions and best practices for writing readable code. It recommends using meaningful names for variables, constants, and methods to improve readability. It also suggests using library utilities when possible to reduce code duplication. Additional tips include returning copies instead of references for immutable objects, catching specific exceptions instead of generic ones, using final keywords, removing unused code, and following object-oriented principles like access modifiers.
This document provides an overview of input and output streams in C++. It discusses the history and introduction of streams, the standard input, output, and error streams (cin, cout, cerr, clog), and common I/O functions and keywords in C++ like cout and cin. The benefits of streams are also mentioned, including increased type safety, reduced errors, extensibility, and inheritability compared to C-style I/O functions.
STL stands for Standard Template Library. It provides common programming data structures and algorithms. The key components of STL are containers like vector and list that store data, iterators that access elements in containers, and algorithms that perform operations on data structures. STL aims to provide generic functions that work on different data types through templates. Common STL algorithms include searching, sorting, copying, and erasing elements from containers.
Efficient Erlang - Performance and memory efficiency of your data by Dmytro L...Erlang Solutions
This document discusses various ways to improve memory and performance efficiency in Erlang programs. It covers the memory usage and performance characteristics of common Erlang data types like literals, immediates, boxed values, lists, tuples, binaries, ETS, and functions. Some key points include: literals and immediates have very low memory overhead; lists have efficient prepend but inefficient append; tuples have good locality but copying is expensive; binaries have reference counting for large values; ETS implies data copying; and external term format is CPU intensive for encoding. The document provides advice on optimizing for these behaviors.
Understanding the components of standard template libraryRahul Sharma
The document discusses the components of the Standard Template Library in C++, which are containers, algorithms, and iterators. Containers store data in memory in an organized way. Algorithms are procedures that process data contained in containers. Iterators are objects like pointers that point to elements in containers, connecting algorithms to containers and playing a key role in manipulating data.
This is an intermediate conversion course for C++, suitable for second year computing students who may have learned Java or another language in first year.
Data structure and algorithm using javaNarayan Sau
This presentation created for people who like to go back to basics of data structure and its implementation. This presentation mostly helps B.Tech , Bsc Computer science students as well as all programmer who wants to develop software in core areas.
The document provides information about data structures and algorithms. It defines key terms like data, information, data structure, algorithm and different types of algorithms. It discusses linear data structures like arrays, operations on arrays like traversing, searching, inserting and deleting elements. It also covers recursive functions, recursion concept, searching algorithms like sequential search and binary search along with their algorithms and examples.
The document provides coding conventions and best practices for writing readable code. It recommends using meaningful names for variables, constants, and methods to improve readability. It also suggests using library utilities when possible to reduce code duplication. Additional tips include returning copies instead of references for immutable objects, catching specific exceptions instead of generic ones, using final keywords, removing unused code, and following object-oriented principles like access modifiers.
This document provides an overview of input and output streams in C++. It discusses the history and introduction of streams, the standard input, output, and error streams (cin, cout, cerr, clog), and common I/O functions and keywords in C++ like cout and cin. The benefits of streams are also mentioned, including increased type safety, reduced errors, extensibility, and inheritability compared to C-style I/O functions.
STL stands for Standard Template Library. It provides common programming data structures and algorithms. The key components of STL are containers like vector and list that store data, iterators that access elements in containers, and algorithms that perform operations on data structures. STL aims to provide generic functions that work on different data types through templates. Common STL algorithms include searching, sorting, copying, and erasing elements from containers.
Processing data with Python, using standard library modules you (probably) ne...gjcross
Tutorial #2 from PyCon AU 2012
You have data.
You have Python.
You also have a lot of choices about the best way to work with that data...
Ever wondered when you would use a tuple, list, dictionary, set, ordered dictionary, bucket, queue, counter or named tuple? Phew!
Do you know when to use a loop, iterator or generator to work through a data container?
Why are there so many different "containers" to hold data?
What are the best ways to work with these data containers?
This tutorial will give you all the basics to effectively working with data containers and iterators in Python. Along the way we will cover some very useful modules from the standard library that you may not have used before and will end up wondering how you ever did without them.
This tutorial is aimed at Python beginners. Bring along your laptop so you can interactively work through some of the examples in the tutorial. If you can, install ipython (http://ipython.org/) as we will use it for the demonstrations.
we are innovative,we are different,we are genius so they call us idiots
Visit us for movies,videos,documentaries,sports,funny pics and many more join www.globalidiots.com
The document provides an introduction to the C++ Standard Template Library (STL). It discusses templates and generic programming in C++. It then describes the main components of STL - containers, algorithms, and iterators. It explains common sequence containers like vector, list, deque; associative containers like set and map; and container adaptors like stack and queue. It discusses how to define and use these containers to store and manipulate data. It also covers concepts like iterators to access container elements and algorithms that operate on containers.
The document discusses file input and output streams in C++. It covers key topics like:
- Opening files using constructors and the open() function
- Using input and output streams like ifstream and ofstream to read from and write to files
- Controlling file pointers using functions like seekg(), seekp(), tellg(), and tellp()
- Performing sequential and random access file I/O using functions like put(), get(), read(), and write()
- Handling errors during file operations using functions in the ios class like fail(), eof(), bad(), and good()
This document discusses file input/output (I/O) in C++. It covers:
1) Stream classes like ifstream and ofstream that represent input/output data flows to files.
2) Formatted and binary I/O - formatted stores data as text which is inefficient for large numbers, while binary stores directly in memory format.
3) Reading and writing objects using binary I/O by casting object addresses and writing the full object size in bytes.
The document discusses the key components of the Standard Template Library (STL) in C++, including containers, iterators, and algorithms. It explains that STL containers manage collections of objects, iterators allow traversing container elements, and algorithms perform operations on elements using iterators. The main STL containers like vector, list, deque, set, and map are introduced along with their basic functionality. Iterators provide a common interface for traversing container elements. Algorithms operate on elements through iterators but are independent of container implementations.
This document provides an introduction and overview of standard library functions in C++. It discusses different header files like stdio.h, string.h, math.h, iostream.h, and ctype.h that contain commonly used functions. Examples of functions from each header file are listed, such as functions for input/output, string manipulation, mathematical operations, and character classification. Specific string and character related functions like isalpha, isdigit, toupper, and tolower are also explained with examples.
The document discusses the C++ Standard Library and Standard Template Library (STL). It explains that the Standard Library contains classes and functions organized into a Standard Function Library and Object-Oriented Class Library. It also describes templates as a way to write generic functions and classes that can work on different data types. The STL is further described as a set of template classes that provide common data structures like lists, stacks, and arrays. Key components of the STL include containers for storing data, iterators for accessing elements in containers, and algorithms for manipulating data. Common containers, iterators, and algorithms are defined along with examples.
The C++ Standard Library provides functions for common tasks like math, strings, I/O, and more. It includes header files that replace older C-style headers. Key headers include <iostream> for I/O, <cmath> for math functions, and <cctype> for character functions. Functions cover tasks from calculating sines and cosines to converting cases and checking digit/letter types. The Standard Library makes programming easier by providing these useful and necessary capabilities.
The document discusses data structures and algorithms. It defines arrays as a series of objects of the same size and type, where each object is an element that can be accessed via an index. Algorithms are described as finite sequences of instructions to solve problems, with analysis of algorithms determining the resources like time and storage required.
The document discusses the Standard Template Library (STL) which provides common classes and functions for C++ programs. It has three main components: (1) containers which store and organize data, (2) algorithms which perform operations on data in containers, and (3) iterators which are used by algorithms to access elements in containers. Some common STL containers include vectors for sequential data, sets and maps for associative data, and queues and stacks as container adaptors.
Regular expressions are a powerful tool for searching, parsing, and modifying text patterns. They allow complex patterns to be matched with simple syntax. Some key uses of regular expressions include validating formats, extracting data from strings, and finding and replacing substrings. Regular expressions use special characters to match literal, quantified, grouped, and alternative character patterns across the start, end, or anywhere within a string.
1. Data structures organize data in memory for efficient access and processing. They represent relationships between data values through placement and linking of the values.
2. Algorithms are finite sets of instructions that take inputs, produce outputs, and terminate after a finite number of unambiguous steps. Common data structures and algorithms are analyzed based on their time and space complexity.
3. Data structures can be linear, with sequential elements, or non-linear, with branching elements. Abstract data types define operations on values independently of implementation through inheritance and polymorphism.
The document discusses the C++ Standard Template Library (STL). It provides three main components - containers, algorithms, and iterators. Containers like vectors, lists, and maps store and organize data. Algorithms like sort, search act on the containers. Iterators are generalized pointers that interface between containers and algorithms. The STL achieves efficiency through templates and provides commonly used data structures and algorithms out of the box.
This document provides an overview of data structures and algorithms analysis. It discusses big-O notation and how it is used to analyze computational complexity and asymptotic complexity of algorithms. Various growth functions like O(n), O(n^2), O(log n) are explained. Experimental and theoretical analysis methods are described and limitations of experimental analysis are highlighted. Key aspects like analyzing loop executions and nested loops are covered. The document also provides examples of analyzing algorithms and comparing their efficiency using big-O notation.
Concept and Definition of Data Structures
Introduction to Data Structures: Information and its meaning, Array in C++: The array as an ADT, Using one dimensional array, Two dimensional array, Multi dimensional array, Structure , Union, Classes in C++.
https://github.com/ashim888/dataStructureAndAlgorithm
The document discusses various addressing modes supported by Pentium processors including register, immediate, and memory addressing modes. It describes simple addressing modes like register and immediate, as well as different memory addressing modes like direct, indirect, based, indexed, and based-indexed addressing. Examples of using arrays and different addressing modes for operations like insertion sort and finding sums are also provided. Performance tests show benefits of supporting flexible addressing modes over just indirect addressing and benefits of using scale factors.
TokuDB and RocksDB are two write-optimized database engines that can be used with Percona. The document compares their implementations of fractal trees and LSM trees, caching approaches, storage on disk, benchmarks showing their performance for different workloads, and features. Key differences include TokuDB using log and block files while RocksDB uses WAL and SST files, and their approaches to caching blocks, memtables, and indexes in memory. Benchmarks showed varying performance depending on the workload and tuning parameters.
Presentation on Auto Tuning delivered as part of our "Software for Multicore Processors" course at UT Austin. It covers the basics of AutoTuning and details of two library generators called PhiPAC and ATLAS.
Processing data with Python, using standard library modules you (probably) ne...gjcross
Tutorial #2 from PyCon AU 2012
You have data.
You have Python.
You also have a lot of choices about the best way to work with that data...
Ever wondered when you would use a tuple, list, dictionary, set, ordered dictionary, bucket, queue, counter or named tuple? Phew!
Do you know when to use a loop, iterator or generator to work through a data container?
Why are there so many different "containers" to hold data?
What are the best ways to work with these data containers?
This tutorial will give you all the basics to effectively working with data containers and iterators in Python. Along the way we will cover some very useful modules from the standard library that you may not have used before and will end up wondering how you ever did without them.
This tutorial is aimed at Python beginners. Bring along your laptop so you can interactively work through some of the examples in the tutorial. If you can, install ipython (http://ipython.org/) as we will use it for the demonstrations.
we are innovative,we are different,we are genius so they call us idiots
Visit us for movies,videos,documentaries,sports,funny pics and many more join www.globalidiots.com
The document provides an introduction to the C++ Standard Template Library (STL). It discusses templates and generic programming in C++. It then describes the main components of STL - containers, algorithms, and iterators. It explains common sequence containers like vector, list, deque; associative containers like set and map; and container adaptors like stack and queue. It discusses how to define and use these containers to store and manipulate data. It also covers concepts like iterators to access container elements and algorithms that operate on containers.
The document discusses file input and output streams in C++. It covers key topics like:
- Opening files using constructors and the open() function
- Using input and output streams like ifstream and ofstream to read from and write to files
- Controlling file pointers using functions like seekg(), seekp(), tellg(), and tellp()
- Performing sequential and random access file I/O using functions like put(), get(), read(), and write()
- Handling errors during file operations using functions in the ios class like fail(), eof(), bad(), and good()
This document discusses file input/output (I/O) in C++. It covers:
1) Stream classes like ifstream and ofstream that represent input/output data flows to files.
2) Formatted and binary I/O - formatted stores data as text which is inefficient for large numbers, while binary stores directly in memory format.
3) Reading and writing objects using binary I/O by casting object addresses and writing the full object size in bytes.
The document discusses the key components of the Standard Template Library (STL) in C++, including containers, iterators, and algorithms. It explains that STL containers manage collections of objects, iterators allow traversing container elements, and algorithms perform operations on elements using iterators. The main STL containers like vector, list, deque, set, and map are introduced along with their basic functionality. Iterators provide a common interface for traversing container elements. Algorithms operate on elements through iterators but are independent of container implementations.
This document provides an introduction and overview of standard library functions in C++. It discusses different header files like stdio.h, string.h, math.h, iostream.h, and ctype.h that contain commonly used functions. Examples of functions from each header file are listed, such as functions for input/output, string manipulation, mathematical operations, and character classification. Specific string and character related functions like isalpha, isdigit, toupper, and tolower are also explained with examples.
The document discusses the C++ Standard Library and Standard Template Library (STL). It explains that the Standard Library contains classes and functions organized into a Standard Function Library and Object-Oriented Class Library. It also describes templates as a way to write generic functions and classes that can work on different data types. The STL is further described as a set of template classes that provide common data structures like lists, stacks, and arrays. Key components of the STL include containers for storing data, iterators for accessing elements in containers, and algorithms for manipulating data. Common containers, iterators, and algorithms are defined along with examples.
The C++ Standard Library provides functions for common tasks like math, strings, I/O, and more. It includes header files that replace older C-style headers. Key headers include <iostream> for I/O, <cmath> for math functions, and <cctype> for character functions. Functions cover tasks from calculating sines and cosines to converting cases and checking digit/letter types. The Standard Library makes programming easier by providing these useful and necessary capabilities.
The document discusses data structures and algorithms. It defines arrays as a series of objects of the same size and type, where each object is an element that can be accessed via an index. Algorithms are described as finite sequences of instructions to solve problems, with analysis of algorithms determining the resources like time and storage required.
The document discusses the Standard Template Library (STL) which provides common classes and functions for C++ programs. It has three main components: (1) containers which store and organize data, (2) algorithms which perform operations on data in containers, and (3) iterators which are used by algorithms to access elements in containers. Some common STL containers include vectors for sequential data, sets and maps for associative data, and queues and stacks as container adaptors.
Regular expressions are a powerful tool for searching, parsing, and modifying text patterns. They allow complex patterns to be matched with simple syntax. Some key uses of regular expressions include validating formats, extracting data from strings, and finding and replacing substrings. Regular expressions use special characters to match literal, quantified, grouped, and alternative character patterns across the start, end, or anywhere within a string.
1. Data structures organize data in memory for efficient access and processing. They represent relationships between data values through placement and linking of the values.
2. Algorithms are finite sets of instructions that take inputs, produce outputs, and terminate after a finite number of unambiguous steps. Common data structures and algorithms are analyzed based on their time and space complexity.
3. Data structures can be linear, with sequential elements, or non-linear, with branching elements. Abstract data types define operations on values independently of implementation through inheritance and polymorphism.
The document discusses the C++ Standard Template Library (STL). It provides three main components - containers, algorithms, and iterators. Containers like vectors, lists, and maps store and organize data. Algorithms like sort, search act on the containers. Iterators are generalized pointers that interface between containers and algorithms. The STL achieves efficiency through templates and provides commonly used data structures and algorithms out of the box.
This document provides an overview of data structures and algorithms analysis. It discusses big-O notation and how it is used to analyze computational complexity and asymptotic complexity of algorithms. Various growth functions like O(n), O(n^2), O(log n) are explained. Experimental and theoretical analysis methods are described and limitations of experimental analysis are highlighted. Key aspects like analyzing loop executions and nested loops are covered. The document also provides examples of analyzing algorithms and comparing their efficiency using big-O notation.
Concept and Definition of Data Structures
Introduction to Data Structures: Information and its meaning, Array in C++: The array as an ADT, Using one dimensional array, Two dimensional array, Multi dimensional array, Structure , Union, Classes in C++.
https://github.com/ashim888/dataStructureAndAlgorithm
The document discusses various addressing modes supported by Pentium processors including register, immediate, and memory addressing modes. It describes simple addressing modes like register and immediate, as well as different memory addressing modes like direct, indirect, based, indexed, and based-indexed addressing. Examples of using arrays and different addressing modes for operations like insertion sort and finding sums are also provided. Performance tests show benefits of supporting flexible addressing modes over just indirect addressing and benefits of using scale factors.
TokuDB and RocksDB are two write-optimized database engines that can be used with Percona. The document compares their implementations of fractal trees and LSM trees, caching approaches, storage on disk, benchmarks showing their performance for different workloads, and features. Key differences include TokuDB using log and block files while RocksDB uses WAL and SST files, and their approaches to caching blocks, memtables, and indexes in memory. Benchmarks showed varying performance depending on the workload and tuning parameters.
Presentation on Auto Tuning delivered as part of our "Software for Multicore Processors" course at UT Austin. It covers the basics of AutoTuning and details of two library generators called PhiPAC and ATLAS.
This document provides an overview of the Python programming language. It discusses Python's history and design, data types like integers, floats, strings, lists, tuples and dictionaries. It also covers core concepts like variables, expressions, control flow with if/else statements and loops. The document demonstrates how to take user input, read and write files, and describes moving Python code to files to make it reusable.
Collections and generics allow storing multiple objects of the same type. Generic collections like List<T>, Queue<T>, and Dictionary<TKey, TValue> provide type-safety without boxing/unboxing. Different collection types have different performance characteristics depending on their implementation - arrays and lists have fast indexed access but slow removal while linked lists are slower to access but more memory efficient. Choosing the right collection type depends on the specific access patterns and operations needed.
Verilog is a hardware description language used to design digital circuits. It allows designs to be described at different levels of abstraction, from behavioral to gate level. At the behavioral level, algorithms and dataflow are described. Modules define design entities and are instantiated within other modules. Always and initial blocks specify concurrent and sequential procedural blocks. Dataflow and gate-level modeling instantiate primitives like logic gates. Verilog supports procedural assignments, parameters, user-defined tasks and functions, and testbenches for simulation.
The document describes different types of editors used in HDL design including schematic and layout editors.
Schematic editors allow designers to capture circuit connectivity and hierarchy using libraries of component symbols. Layout editors allow designers to specify the physical structure of a design using geometric shapes.
Both editor types provide file and display commands, drawing tools to create and edit circuit elements, and data structures like linked lists and quad trees to store and query design information.
The document provides details about the architecture of SIC and SIC/XE machines. It describes the memory, registers, data formats, instruction formats, addressing modes, instruction set, and input/output for both machines. It also provides example programs to illustrate different instructions and addressing modes. Additionally, it explains CISC machines in general and provides details about the VAX and Pentium Pro architectures as examples of CISC instruction set architectures.
Python is a general-purpose programming language that is highly readable. It uses English keywords and has fewer syntactical constructions than other languages. Python supports object-oriented, interactive, and procedural programming. It has various data types like numbers, strings, lists, tuples and dictionaries. Python uses constructs like if/else, for loops, functions and classes to control program flow and structure code.
Modern enterprise data—tracking key performance indicators like conversions or click-throughs—exhibits a pathologically high dimensionality, which requires re-thinking data representation to make analysis tractable.
This document introduces system software and the Simplified Instructional Computer (SIC) architecture. It discusses the SIC's memory, registers, data formats, instruction formats, addressing modes, instruction set, and input/output. Examples of SIC assembly language programs are provided to demonstrate various operations like data movement, arithmetic, looping, indexing, and subroutines. It also introduces an extended version, SIC/XE, which has additional registers and supports floating-point data and new instruction formats.
Python is an interpreted, object-oriented, high-level programming language with dynamic typing and dynamic binding. Its simple, easy to learn syntax emphasizes readability and it uses significant indentation to delimit code blocks rather than curly braces or keywords. Python supports modules and packages, which encourages program modularity and code reuse. It also has a large standard library.
This document provides guidance on database sizing including:
1. Reasons to size a database initially and continually such as selecting hardware, storage requirements, and understanding data characteristics.
2. Common data types and their storage sizes in bytes.
3. How to calculate average row size and the number of rows that fit in a database block.
4. How to calculate the number of blocks needed to store a table based on its number of rows and the rows per block.
5. Differences in sizing indexes compared to tables.
6. The process of sizing all major database objects and adding them to determine total disk space needs.
The document describes an example of using Pig Latin to analyze weather data. It loads a data file with year, temperature, and quality fields for different years. It then filters the data, groups it by year, and uses a MAX function to calculate the maximum recorded temperature for each year. This provides a concise high-level summary of the key steps and goals described in the document.
This document discusses computer algorithms and provides examples of algorithms in Python. It begins by defining an algorithm and providing examples of sorting algorithms like insertion sort, selection sort, and merge sort. It then discusses searching algorithms like linear search and binary search, including their time complexities. Other topics covered include advantages of Python, types of problems solved by algorithms, and limitations of binary search.
The document discusses computer architecture and the MIPS instruction set architecture. It begins by defining computer architecture as the instruction set architecture (ISA), which is the boundary between hardware and software and defines what a machine can do. It also discusses machine organization, which is how the hardware works to implement the ISA. The document then covers various aspects of the MIPS ISA, including its register-based load/store architecture, instruction formats, common operations like data movement and arithmetic, and addressing modes.
Redis is an in-memory data structure store that can be used as a database, cache, or message broker. It supports string, hash, list, set and sorted set data types and allows for atomic operations and transactions. While data resides in memory, Redis can optionally persist data to disk for durability. It is useful for caching, real-time analytics, queues and more due to its speed, flexibility and support for pub/sub messaging.
The Ring programming language version 1.9 book - Part 100 of 210Mahmoud Samir Fayed
This document provides reference information about the Ring programming language, including lists of its keywords, built-in functions, and types of errors. It describes the language's architecture as having Ring applications that use Ring libraries and extensions written in C/C++. It also covers Ring's memory management using garbage collection, and how data like strings, numbers, and binary data are represented internally.
AustenX is a parser generator built in Java that uses Parsing Expression Grammars and packrat memorization. It handles left recursion well through an interesting solution. AustenX is generated using SkeletonX, a code generator tool that is also interesting. The presentation discusses the features and capabilities of AustenX, examples of grammars and parsing, and future directions including improved tokenization and language targets. SkeletonX is introduced as the code generator used to build AustenX.
Similar to Data efficiency on BEAM - Choose the right data representation by Dmytro Lytovchenko (20)
UI5con 2024 - Bring Your Own Design SystemPeter Muessig
How do you combine the OpenUI5/SAPUI5 programming model with a design system that makes its controls available as Web Components? Since OpenUI5/SAPUI5 1.120, the framework supports the integration of any Web Components. This makes it possible, for example, to natively embed own Web Components of your design system which are created with Stencil. The integration embeds the Web Components in a way that they can be used naturally in XMLViews, like with standard UI5 controls, and can be bound with data binding. Learn how you can also make use of the Web Components base class in OpenUI5/SAPUI5 to also integrate your Web Components and get inspired by the solution to generate a custom UI5 library providing the Web Components control wrappers for the native ones.
Using Query Store in Azure PostgreSQL to Understand Query PerformanceGrant Fritchey
Microsoft has added an excellent new extension in PostgreSQL on their Azure Platform. This session, presented at Posette 2024, covers what Query Store is and the types of information you can get out of it.
UI5con 2024 - Keynote: Latest News about UI5 and it’s EcosystemPeter Muessig
Learn about the latest innovations in and around OpenUI5/SAPUI5: UI5 Tooling, UI5 linter, UI5 Web Components, Web Components Integration, UI5 2.x, UI5 GenAI.
Recording:
https://www.youtube.com/live/MSdGLG2zLy8?si=INxBHTqkwHhxV5Ta&t=0
WWDC 2024 Keynote Review: For CocoaCoders AustinPatrick Weigel
Overview of WWDC 2024 Keynote Address.
Covers: Apple Intelligence, iOS18, macOS Sequoia, iPadOS, watchOS, visionOS, and Apple TV+.
Understandable dialogue on Apple TV+
On-device app controlling AI.
Access to ChatGPT with a guest appearance by Chief Data Thief Sam Altman!
App Locking! iPhone Mirroring! And a Calculator!!
The Key to Digital Success_ A Comprehensive Guide to Continuous Testing Integ...kalichargn70th171
In today's business landscape, digital integration is ubiquitous, demanding swift innovation as a necessity rather than a luxury. In a fiercely competitive market with heightened customer expectations, the timely launch of flawless digital products is crucial for both acquisition and retention—any delay risks ceding market share to competitors.
Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...XfilesPro
Wondering how X-Sign gained popularity in a quick time span? This eSign functionality of XfilesPro DocuPrime has many advancements to offer for Salesforce users. Explore them now!
14 th Edition of International conference on computer visionShulagnaSarkar2
About the event
14th Edition of International conference on computer vision
Computer conferences organized by ScienceFather group. ScienceFather takes the privilege to invite speakers participants students delegates and exhibitors from across the globe to its International Conference on computer conferences to be held in the Various Beautiful cites of the world. computer conferences are a discussion of common Inventions-related issues and additionally trade information share proof thoughts and insight into advanced developments in the science inventions service system. New technology may create many materials and devices with a vast range of applications such as in Science medicine electronics biomaterials energy production and consumer products.
Nomination are Open!! Don't Miss it
Visit: computer.scifat.com
Award Nomination: https://x-i.me/ishnom
Conference Submission: https://x-i.me/anicon
For Enquiry: Computer@scifat.com
Most important New features of Oracle 23c for DBAs and Developers. You can get more idea from my youtube channel video from https://youtu.be/XvL5WtaC20A
Flutter is a popular open source, cross-platform framework developed by Google. In this webinar we'll explore Flutter and its architecture, delve into the Flutter Embedder and Flutter’s Dart language, discover how to leverage Flutter for embedded device development, learn about Automotive Grade Linux (AGL) and its consortium and understand the rationale behind AGL's choice of Flutter for next-gen IVI systems. Don’t miss this opportunity to discover whether Flutter is right for your project.
Liberarsi dai framework con i Web Component.pptxMassimo Artizzu
In Italian
Presentazione sulle feature e l'utilizzo dei Web Component nell sviluppo di pagine e applicazioni web. Racconto delle ragioni storiche dell'avvento dei Web Component. Evidenziazione dei vantaggi e delle sfide poste, indicazione delle best practices, con particolare accento sulla possibilità di usare web component per facilitare la migrazione delle proprie applicazioni verso nuovi stack tecnologici.
3. BEAM File
● A simple container with sections
○ Code
○ LitT, StrT (literals and strings)
○ Atom, AtU8
● Literals have dedicated location in memory
(constant pool)
● Access is O(1)
● Used literals are copied during code upgrade
“FOR1”, Length:32/big, “BEAM”
“Code”, Length:32/big,
Code/binary
“LitT”, Length:32/big,
Compressed/binary
…
4. Term
● Is a machine word, 64 (or 32) bit
● Has 2 bits reserved at all times, these bits
define the contained data type
Can be:
● An immediate value
● C pointer to a list cell
● C pointer to a boxed value
● A header, marks beginning of a “box”
a machine word
5. BEAM VM Structures are all terms
● Heap — array[] of Term
● Stack — array[] of Term, inside the young heap
● VM Registers — array[] of Term
Data types on heap
● Tuple — array[] of Term on heap
● List — array[2] of Term
● Binary & Bit String — array[] of words
● Float — one C double on heap (stored as 2 or 3 words)
6. Immediate value facts
● Always have size of 1 word
● Extra 2 or 4 bits define the type of data
Can be
● Small integers
● Local pids and ports
● Atoms
● NIL [] (empty list)
● Internal catch values
An immediate-2 value
An immediate-1 value
60 (28) bits for IMM1 value
64 (32) bits
58 (26) bits for IMM2 value
* VM NIL is not Elixir nil
7. List facts
● C-style single linked list
● A list cell is 2 words, containing the
head and the tail.
● Any list term is a pointer to a cell
● Last element may be a NIL []
● Can only iterate forward
● Cheap to prepend
[0 | []] 1 cell
[0 | [1 | []]] 2 cells
A list value, C pointer
1
Tail: [ ]
0
List value for the Tail, C pointer
* NIL in VM represents an empty list
[] and is not the same as Elixir nil
8. List tricks
● Store another value instead of a trailing NIL
○ Improper list
○ [X | Y] takes 2 words
which is smaller, than [X, Y | []] — 4 words,
also smaller, than {X, Y} — 3 words
● Reversing a list is cheap (copy)
○ Better than an inefficient algorithm which builds the result forward
● Reusing any tail of any list cell in multiple values is cheap.
This also means prepending any value.
● LC can be optimised if the result is not used (the unused
list will never be created)
X
Y
9. Lists: Please avoid
● Length operation is O(N), appending is O(N), finding Nth
element is O(N).
● – – operation is O(N*M), use ordsets or gb_sets for
the right arg
○ It is not too bad if the right argument is short.
○ Improved in OTP 22
● ++ operation is O(N) because: finding last element.
● lists:flatten, lists:reverse build a new list.
● When doing list-building, ensure that your code is
tail-recursive.
10. IO Lists
● Nested lists which contain other
lists or single characters or binaries
(also Elixir strings)
● Easy to “flatten” to a binary or a
string when is ready O(N); many
functions can consume from an
iolist without flattening
● Prepend and append are O(1)
● Fast and efficient
[
“Hello”,
“, ”,
[‘w’, “orl”],
[<<“d!”>>],
[]
]
11. IO Lists
● Prepending X to Y is O(1), but sometimes you need also to append:
○ [X | Y] — X is inserted before the first element of Y
○ [Y, X] — iolist is created, where X goes after Y — very cheap operation
● You don’t have to rebuild the large list to join multiple lists!
○ [X, Y, Z, T] where X, Y, Z and T are large lists — creates an iolist
○ Replaces lists:append
● Many functions in Erlang accept iolists as well as strings
○ File and socket functions, unicode functions, printing etc.
○ Types to look for: iolist() or iodata() (defined literally as iolist() | binary())
● Do more IO lists, it is good
12. a machine word
Term
● Is a machine word, 64 (or 32) bit
● Has 2 bits reserved, these bits define the
contained data type
Can be:
● An immediate value
● Can be a C pointer to a list cell
● Can be a C pointer to a boxed value
● Can be a header, marks beginning of a box
13. Boxed values
● Term value contains a pointer
● Binaries, floats, tuples, maps, local and
external refs, pids, and ports, big integers,
function closures, exports. Also temporary
data for internal functions
A boxed value, C pointer
14. Boxed values
● Term value contains a pointer
● Boxes always have 1 word header
● Binaries, floats, tuples, maps, local and
external refs, pids, and ports, big integers,
function closures, exports. Also temporary
data for internal functions
● Boxes always have 1 word header
○ Subtag (yellow bits), which defines what’s in the
box, and arity which defines size
A boxed value, C pointer
Header
array[] of Termarray[] of Termarray[] of word (term)
15. Tuple
● Tuple is a boxed value and exists on heap
{hello, “world”}
Tuple, C pointer
16. Tuple
● Tuple is a boxed value and exists on heap
● Tuple has 1 word header with tuple tag bits
and size (arity)
● Arity is limited to 26 bits (67M elements)
● Elements are a simple term array
● Changing a tuple element makes a full copy
except when the compiler can optimize it
Tuple, C pointer
Header
array[] of Termarray[] of Termarray[] of Term
17. Tuple tricks
● Random value lookup:
○ Accessing a random tuple element is O(1)
○ A literal tuple in your module is O(1)
● Setting multiple elements of a tuple will be optimized if:
○ Descending integer indexes are used
○ Tuple result is chained to the next setelement
○ No other function calls happen in between
● In other situations consider converting tuple to a list, map,
tree, or a more complex structure
18. Map facts
● Map is a boxed value and exists on heap
Map, C pointer
19. Map facts
● Map is a boxed value and exists on heap
○ Shorter than 32 keys: sorted list
○ HAMT (Hash Array Mapped Trie)
● Update is slow
● Lookup is faster than n-th list element
● Lookup is slower than indexing a tuple
HAMT
Map, C pointer
{Key, Value,
Key2, Value, ...}
Header
Header
20. Binary facts
● Binary is a boxed value and exists on
some heap
● A large binary is made of:
○ a heap bin on the binary heap
○ a refc bin on the process heap which points
to a refc bin
● A proc bin is a local small binary with a
2 word header and < 64b data
● A subbinary and match context are two
special cases
A process
PROC bin
REFC bin
Binary heap
HEAP bin
A process
REFC bin
SUB bin
21. Binaries: The good news
● Chain of binary append operations will be optimized if there
was ONLY ONE use of that binary throughout the operation.
● Unused variables in a binary match can be optimized away
○ Skipping/unused part of binary in all function clauses is globally
optimized away
f(<<_,X/binary>>) -> …
● How to see binary optimizations:
○ erlc +bin_opt_info MyModule.erl
○ export ERL_COMPILER_OPTIONS=bin_opt_info
22. Binaries: Please avoid
● Exposing large bin to multiple processes increases refcount and
holds the binary alive until the GC runs on all these processes!
● When growing a binary — a copy is created:
○ When the binary is sent as a message in the middle of manipulation
○ When the binary is inserted into ETS, sent to a port or to a NIF
○ When matching a binary (match context creates a pointer to the binary data)
23. External term format (ETF)
● Produced by erlang:term_to_binary call
● ETF is used when
○ Sending terms over network
○ Storing terms on disk: Mnesia, DETS, disk_log module
○ Database binary fields with Erlang term in them
● Atoms may be optimal in memory, but not in ETF
○ Not always true: ETF protocol is able to carry an atom table between connected nodes
○ Remote pids and remote ports contain hostname atom
○ For making the size smaller one can e.g. change atoms to small integers
24. Exports/Imports and Closures
● Export is a function reference:
○ Erlang: fun lists:foreach/1
○ Elixir: &Enum.each/2
● Represented internally as a {M, F, Arity} + extra fields
● A closure is same as an export + some captured values
● Sending function closures and exports over the network is not nice
○ The function code may be missing on the remote end
○ The remote code may be outdated
○ The remote code might be not what you think
25. Other
● Float takes (2 or 3 words on the heap) + 1 for the term itself — expensive.
○ Consider N/M rational fractions
○ Consider fixed point integers
● Small integer 1 word (28 or 60 bits w/sign) automatically becomes a BIG
integer on overflow (3x memory usage)
26. Binary
Heap
Data is copied, when it
● leaves the process as a message to
another process or port
● is used as arguments when spawning a
process
● is exchanged with ETS
Exception:
● Large binaries > 64 bytes are reference
counted and only references are copied
Process
Value
ETS
Ports
Other
Processes
Value
64+ bytes
Reference Value
27. Profile and measure
● Knowing the theory helps, but one must also know their data!
● Do not guess
● Print (see) and inspect your data structures
● Profile and measure your memory
○ erlang:system_info
○ erlang:process_info
○ erts_debug:size/1
○ erts_debug:flat_size/1
28. Performance: Optimize First
● Disk storage access
● Database access and slow queries
● Remote network access
…..
● Inefficient and slow algorithms & data structures
29. More information about internal structure for
BEAM memory can be found at
http://beam-wisdoms.clau.se
also
happi/theBeamBook
Dmytro Lytovchenko
Erlang Solutions, Sweden
@kvakvs