This document provides guidance on optimizing C# code for performance. It discusses topics like memory management, flow and control structures, data structures, and function calls. Some key recommendations include preferring single large assemblies to multiple smaller ones, reusing memory through object pooling rather than frequent allocation, using 'for' loops instead of 'foreach' when possible, and choosing the appropriate collection type based on usage needs. Premature optimization is discouraged, and exceptions should generally not be overused to control program flow.
Software Design: Impact of Memory Usage (Copying, Cloning and Aliases)Adair Dingle
Software design requires a solid understanding of memory, especially as it pertains to type relationships, and dynamic behavior, in object-oriented design. An understanding of the overhead of copying and cloning supports an evaluation of short- and long-term costs and benefits of various design choices as they impact performance and maintainability.
The .NET Garbage Collector (GC) is really cool. It helps providing our applications with virtually unlimited memory, so we can focus on writing code instead of manually freeing up memory. But how does .NET manage that memory? What are hidden allocations? Are strings evil? It still matters to understand when and where memory is allocated. In this talk, we’ll go over the base concepts of .NET memory management and explore how .NET helps us and how we can help .NET – making our apps better. Expect profiling, Intermediate Language (IL), ClrMD and more!
The .NET Garbage Collector (GC) is really cool. It helps providing our applications with virtually unlimited memory, so we can focus on writing code instead of manually freeing up memory. But how does .NET manage that memory? What are hidden allocations? Are strings evil? It still matters to understand when and where memory is allocated. In this talk, we’ll go over the base concepts of .NET memory management and explore how .NET helps us and how we can help .NET – making our apps better. Expect profiling, Intermediate Language (IL), ClrMD and more!
A comprehensive walkthrough of how to manage infrastructure-as-code using Terraform. This presentation includes an introduction to Terraform, a discussion of how to manage Terraform state, how to use Terraform modules, an overview of best practices (e.g. isolation, versioning, loops, if-statements), and a list of gotchas to look out for.
For a written and more in-depth version of this presentation, check out the "Comprehensive Guide to Terraform" blog post series: https://blog.gruntwork.io/a-comprehensive-guide-to-terraform-b3d32832baca
The main body of work related to supporting dynamic languages on the JVM at Oracle today is done within the Nashorn project. While on the surface it looks like we're busy creating a JavaScript runtime, in reality JavaScript is only the beginning, and not the ultimate goal. Nashorn has served as the proving ground for new approaches for implementing a dynamic language on top of the JVM, and we're eager to – once solidified – crystallize these into a reusable dynamic language implementer's toolkit. We have faced challenges of optimally mapping JavaScript local variables to JVM types (or: "hey, there's a static type inference algorithm in your dynamic language compiler"), doing liveness analysis, cutting up methods too large to fit into a single JVM method, efficiently representing large array and object literals in compiled code, creating a system for on-demand compilation of several type-specialized variants of the same function, and more. Along the way, we have reached the limits of our initial internal representation (fun fact: you can't do liveness analysis on an AST. We learned it the hard way.) and started sketching up an intermediate representation that would be easy to emit from a dynamic language compiler, and that could be taken over by a toolchain to perform the operations described above then on it and finally output standard Java bytecode for JIT to take over. Elevator pitch: like LLVM, but for dynamic languages on the JVM.
Experiments in Sharing Java VM Technology with CRubyMatthew Gaudet
IBM is developing a just-in-time (JIT) compiler called Testarossa based on its Open Runtime (OMR) toolkit. The goal is to integrate the JIT compiler into MRI Ruby to improve performance without changing how MRI works. So far, the JIT supports most opcodes and can run Rails applications, but performance gains are modest. IBM hopes to collaborate with the Ruby community to further optimize Ruby and help make it faster.
An introduction to C++. These slides were used to guide a presentation on C++. The target audience was programmers learning C++ for the first time. As such the content covered basics of modern C++ and some other things that I feel was helpful to know about when starting with C++.
Async and parallel patterns and application design - TechDays2013 NLArie Leeuwesteijn
TechDays2013 NL session on async and parallel programming. Gives an overview of todays relevant .net technologies, examples and tips and tricks. This session will help you to understand and select and use the right async/parallel technology to use in your .net application. (arie@macaw.nl)
Software Design: Impact of Memory Usage (Copying, Cloning and Aliases)Adair Dingle
Software design requires a solid understanding of memory, especially as it pertains to type relationships, and dynamic behavior, in object-oriented design. An understanding of the overhead of copying and cloning supports an evaluation of short- and long-term costs and benefits of various design choices as they impact performance and maintainability.
The .NET Garbage Collector (GC) is really cool. It helps providing our applications with virtually unlimited memory, so we can focus on writing code instead of manually freeing up memory. But how does .NET manage that memory? What are hidden allocations? Are strings evil? It still matters to understand when and where memory is allocated. In this talk, we’ll go over the base concepts of .NET memory management and explore how .NET helps us and how we can help .NET – making our apps better. Expect profiling, Intermediate Language (IL), ClrMD and more!
The .NET Garbage Collector (GC) is really cool. It helps providing our applications with virtually unlimited memory, so we can focus on writing code instead of manually freeing up memory. But how does .NET manage that memory? What are hidden allocations? Are strings evil? It still matters to understand when and where memory is allocated. In this talk, we’ll go over the base concepts of .NET memory management and explore how .NET helps us and how we can help .NET – making our apps better. Expect profiling, Intermediate Language (IL), ClrMD and more!
A comprehensive walkthrough of how to manage infrastructure-as-code using Terraform. This presentation includes an introduction to Terraform, a discussion of how to manage Terraform state, how to use Terraform modules, an overview of best practices (e.g. isolation, versioning, loops, if-statements), and a list of gotchas to look out for.
For a written and more in-depth version of this presentation, check out the "Comprehensive Guide to Terraform" blog post series: https://blog.gruntwork.io/a-comprehensive-guide-to-terraform-b3d32832baca
The main body of work related to supporting dynamic languages on the JVM at Oracle today is done within the Nashorn project. While on the surface it looks like we're busy creating a JavaScript runtime, in reality JavaScript is only the beginning, and not the ultimate goal. Nashorn has served as the proving ground for new approaches for implementing a dynamic language on top of the JVM, and we're eager to – once solidified – crystallize these into a reusable dynamic language implementer's toolkit. We have faced challenges of optimally mapping JavaScript local variables to JVM types (or: "hey, there's a static type inference algorithm in your dynamic language compiler"), doing liveness analysis, cutting up methods too large to fit into a single JVM method, efficiently representing large array and object literals in compiled code, creating a system for on-demand compilation of several type-specialized variants of the same function, and more. Along the way, we have reached the limits of our initial internal representation (fun fact: you can't do liveness analysis on an AST. We learned it the hard way.) and started sketching up an intermediate representation that would be easy to emit from a dynamic language compiler, and that could be taken over by a toolchain to perform the operations described above then on it and finally output standard Java bytecode for JIT to take over. Elevator pitch: like LLVM, but for dynamic languages on the JVM.
Experiments in Sharing Java VM Technology with CRubyMatthew Gaudet
IBM is developing a just-in-time (JIT) compiler called Testarossa based on its Open Runtime (OMR) toolkit. The goal is to integrate the JIT compiler into MRI Ruby to improve performance without changing how MRI works. So far, the JIT supports most opcodes and can run Rails applications, but performance gains are modest. IBM hopes to collaborate with the Ruby community to further optimize Ruby and help make it faster.
An introduction to C++. These slides were used to guide a presentation on C++. The target audience was programmers learning C++ for the first time. As such the content covered basics of modern C++ and some other things that I feel was helpful to know about when starting with C++.
Async and parallel patterns and application design - TechDays2013 NLArie Leeuwesteijn
TechDays2013 NL session on async and parallel programming. Gives an overview of todays relevant .net technologies, examples and tips and tricks. This session will help you to understand and select and use the right async/parallel technology to use in your .net application. (arie@macaw.nl)
This document summarizes the basics of memory management in Python. It discusses key concepts like variables, objects, references, and reference counting. It explains how Python uses reference counting with generational garbage collection to manage memory and clean up unused objects. The document also covers potential issues with reference counting like cyclic references and threads, and how the global interpreter lock impacts multi-threading in Python.
JetBrains Day Seoul - Exploring .NET’s memory management – a trip down memory...Maarten Balliauw
The .NET Garbage Collector (GC) is really cool. It helps providing our applications with virtually unlimited memory, so we can focus on writing code instead of manually freeing up memory. But how does .NET manage that memory? What are hidden allocations? Are strings evil? It still matters to understand when and where memory is allocated. In this talk, we’ll go over the base concepts of .NET memory management and explore how .NET helps us and how we can help .NET – making our apps better. Expect profiling, Intermediate Language (IL), ClrMD and more!
Scarab: SAT-based Constraint Programming System in Scala / Scala上で実現された制約プログラ...scalaconfjp
This document discusses Scarab, a SAT-based constraint programming system developed in Scala. Scarab provides a domain-specific language and APIs for modeling constraint satisfaction problems and solving them using SAT encodings and SAT solvers like Sat4j. It aims to provide an expressive, efficient and customizable workbench for developing SAT-based systems. The document gives examples of using Scarab to model and solve the graph coloring problem and pandiagonal Latin square problem. It also discusses Scarab's features like efficiency, portability and ability to leverage advanced SAT solving techniques.
Supercharging WordPress Development in 2018Adam Tomat
Slide links:
- PHP-FIG: https://www.php-fig.org/psr
- Timber: https://www.upstatement.com/timber/
- Bedrock: https://roots.io/bedrock/
- Lumberjack: https://github.com/Rareloop/lumberjack
- Lumberjack Core: https://github.com/Rareloop/lumberjack-core
- Collections: https://laravel.com/docs/5.6/collections
- PHP-DI: http://php-di.org/
- Lumberjack Validation: https://github.com/Rareloop/lumberjack-validation
- Sessions: https://github.com/Rareloop/lumberjack-core/tree/ft-session
- Lumberjack Example Repo: https://github.com/Rareloop/lumberjack-example
- Laravel Responsable: https://laravel-news.com/laravel-5-5-responsable
Towards the end of 2015 Rareloop launched their WordPress starter theme Lumberjack, which built on open source tools such as Bedrock and Timber. We wanted to move Lumberjack forward inline with everything we have learnt over the years of using it - which meant completely re-writing it from the ground up. The new Lumberjack is now stable and ready for use!
This talk is aimed at anyone involved in working with WordPress, regardless of how technical you are. The beauty of Lumberjack is that you can use as much or as little as you like, so whether you’re new to web development or a seasoned software engineer there will be something here for you.
This document provides an overview of Span<T> in .NET. It begins with background on memory management in .NET and value vs. reference types. It then defines Span<T> as a new value type that represents contiguous regions of memory, whether managed, unmanaged, or on the stack. It explains that Span<T> allows high-performance, low-overhead access to memory without unsafe code. Examples are given of using Span<T> to represent memory from arrays, strings, and other sources. Benchmarks show Span<T> outperforming alternatives like Substring. Real-world uses like parsing delimited strings are demonstrated.
A story of how we went about packaging perl and all of the dependencies that our project has.
Where we were before, the chosen path, and the end result.
The pitfalls and a view on the pros and cons of the previous state of affairs versus the pros/cons of the end result.
Survey of Program Transformation TechnologiesChunhua Liao
This document provides an overview of program transformation techniques, including string-based transformations using scripting languages, compiler-based transformations through direct modification of intermediate representations, rule-based term rewriting, and semantic patching. It discusses challenges in applying program transformations at scale and the need for reusable transformation infrastructures. Example tools that apply different techniques are described, such as Stratego/XT for term rewriting and Coccinelle for semantic patching of C code.
This document provides an overview of Terraform including its key features and how to install, configure, and use Terraform to deploy infrastructure on AWS. It covers topics such as creating EC2 instances and other AWS resources with Terraform, using variables, outputs, and provisioners, implementing modules and workspaces, and managing the Terraform state.
The document discusses various topics related to multi-core programming in .NET including:
1) Concurrent collections like ConcurrentQueue and ConcurrentDictionary that are thread-safe for concurrent access from multiple threads.
2) Synchronization primitives like CountdownEvent, Barrier, and SemaphoreSlim for coordinating threads.
3) Techniques for improving performance like lazy initialization, limiting allocations, and optimizing for caches.
4) Important guidelines for using locks correctly and avoiding common multithreading bugs.
Memory Management & Garbage CollectionAbhishek Sur
The document discusses .NET memory management and garbage collection. It explains that memory is allocated on the managed heap for reference types using new. The garbage collector removes objects from the heap that are no longer referenced to free up memory. It compacts the heap during garbage collection to improve performance. While the garbage collector handles managed memory, it does not free unmanaged resources so classes use finalizers/destructors or implement IDisposable to release unmanaged resources.
Никита Корчагин - Programming Apple iOS with Objective-CDataArt
This document provides an overview of programming iOS apps with Objective-C, including how to get started, the Objective-C and Swift languages, Model-View-Controller (MVC) pattern, differences between desktop and mobile development, and human interface guidelines. Key topics covered include installing the necessary software, understanding core Objective-C concepts like classes, methods, and memory management, using view controllers and the MVC pattern to structure apps, and important considerations for mobile like limited resources and touch interfaces.
This document discusses parallel programming in .NET framework 4.0. It introduces parallel extensions, the task parallel library (TPL), tasks, and Parallel.For/Parallel.ForEach loops. It provides guidance on their proper usage, including ensuring thread safety when accessing shared resources from multiple threads and avoiding potential issues like deadlocks. PLINQ for parallel LINQ queries is also covered.
Avoid memory leaks using unit tests - Swift Delhi Meetup - Chapter 15Raunak Talwar
Slides used in swift delhi meetup chapter 15 at Kite HQ.
Here I've talked about how iOS does its memory management and then problem of reatin cycle and a solution to avoid this through unit tests.
Visual Studio 2010 and the .NET Framework 4 enhance support for parallel programming by providing a new runtime, new class library types, and new diagnostic tools. This presentation is all about parallel programming and its features.
Run Cloud Native MySQL NDB Cluster in KubernetesBernd Ocklin
The more your database aligns with Cloud Native principles such as resilience, scaling, auto-healing and data consistency across all nodes, the better it also runs as DBaaS in Kubernetes. I walk through running databases in Kubernetes and demos manual deployment and deployment with an NDB operator.
This talk was given at the MySQL Dev Room FOSDEM 2021.
For More information, refer to Java EE 7 performance tuning and optimization book:
The book is published by Packt Publishing:
http://www.packtpub.com/java-ee-7-performance-tuning-and-optimization/book
Mock what? What Mock?Learn What is Mocking, and how to use Mocking with ColdFusion testing, development, and continuous integration. Look at Mocking and Stubbing with a touch of Theory and a lot of Examples, including what you could test, and what you should test… and what you shouldn't test (but might be fun).
JavaScript and popular programming paradigms (OOP, AOP, FP, DSL). Overview of the language to see what tools we can leverage to reduce complexity of our projects.
This part goes over language features and looks at OOP and AOP with JavaScript.
The presentation was delivered at ClubAJAX on 2/2/2010.
Blog post: http://lazutkin.com/blog/2010/feb/5/exciting-js-1/
Continued in Part II: http://www.slideshare.net/elazutkin/exciting-javascript-part-ii
Distributed Tensorflow with Kubernetes - data2day - Jakob KaralusJakob Karalus
This document discusses using Distributed Tensorflow with Kubernetes for training neural networks. It covers:
- The need for distributed training to handle large datasets, deep models, and high accuracy requirements.
- Kubernetes as an orchestration tool for scheduling Tensorflow across nodes with GPUs.
- Key concepts like parameter servers, worker replicas, and synchronous/asynchronous training modes.
- Steps for setting up distributed Tensorflow jobs on Kubernetes including defining the cluster, assigning operations, creating training sessions, and packaging into containers.
- Considerations for enabling GPUs, building Docker images, writing deployments, and automating with tools like the Tensorflow Operator.
The document discusses the benefits of moving JIT compilation out of individual JVMs and into a shared, cloud-based compiler service. This "JIT-as-a-Service" approach improves efficiency by allowing optimization resources to be shared and elastic across JVMs. It also enables optimized code to be reused for applications that execute on multiple devices. Moving JIT compilation to the cloud reduces warmup time, memory footprint, and CPU usage for JVMs while improving the level of optimizations that can be performed.
This document summarizes the basics of memory management in Python. It discusses key concepts like variables, objects, references, and reference counting. It explains how Python uses reference counting with generational garbage collection to manage memory and clean up unused objects. The document also covers potential issues with reference counting like cyclic references and threads, and how the global interpreter lock impacts multi-threading in Python.
JetBrains Day Seoul - Exploring .NET’s memory management – a trip down memory...Maarten Balliauw
The .NET Garbage Collector (GC) is really cool. It helps providing our applications with virtually unlimited memory, so we can focus on writing code instead of manually freeing up memory. But how does .NET manage that memory? What are hidden allocations? Are strings evil? It still matters to understand when and where memory is allocated. In this talk, we’ll go over the base concepts of .NET memory management and explore how .NET helps us and how we can help .NET – making our apps better. Expect profiling, Intermediate Language (IL), ClrMD and more!
Scarab: SAT-based Constraint Programming System in Scala / Scala上で実現された制約プログラ...scalaconfjp
This document discusses Scarab, a SAT-based constraint programming system developed in Scala. Scarab provides a domain-specific language and APIs for modeling constraint satisfaction problems and solving them using SAT encodings and SAT solvers like Sat4j. It aims to provide an expressive, efficient and customizable workbench for developing SAT-based systems. The document gives examples of using Scarab to model and solve the graph coloring problem and pandiagonal Latin square problem. It also discusses Scarab's features like efficiency, portability and ability to leverage advanced SAT solving techniques.
Supercharging WordPress Development in 2018Adam Tomat
Slide links:
- PHP-FIG: https://www.php-fig.org/psr
- Timber: https://www.upstatement.com/timber/
- Bedrock: https://roots.io/bedrock/
- Lumberjack: https://github.com/Rareloop/lumberjack
- Lumberjack Core: https://github.com/Rareloop/lumberjack-core
- Collections: https://laravel.com/docs/5.6/collections
- PHP-DI: http://php-di.org/
- Lumberjack Validation: https://github.com/Rareloop/lumberjack-validation
- Sessions: https://github.com/Rareloop/lumberjack-core/tree/ft-session
- Lumberjack Example Repo: https://github.com/Rareloop/lumberjack-example
- Laravel Responsable: https://laravel-news.com/laravel-5-5-responsable
Towards the end of 2015 Rareloop launched their WordPress starter theme Lumberjack, which built on open source tools such as Bedrock and Timber. We wanted to move Lumberjack forward inline with everything we have learnt over the years of using it - which meant completely re-writing it from the ground up. The new Lumberjack is now stable and ready for use!
This talk is aimed at anyone involved in working with WordPress, regardless of how technical you are. The beauty of Lumberjack is that you can use as much or as little as you like, so whether you’re new to web development or a seasoned software engineer there will be something here for you.
This document provides an overview of Span<T> in .NET. It begins with background on memory management in .NET and value vs. reference types. It then defines Span<T> as a new value type that represents contiguous regions of memory, whether managed, unmanaged, or on the stack. It explains that Span<T> allows high-performance, low-overhead access to memory without unsafe code. Examples are given of using Span<T> to represent memory from arrays, strings, and other sources. Benchmarks show Span<T> outperforming alternatives like Substring. Real-world uses like parsing delimited strings are demonstrated.
A story of how we went about packaging perl and all of the dependencies that our project has.
Where we were before, the chosen path, and the end result.
The pitfalls and a view on the pros and cons of the previous state of affairs versus the pros/cons of the end result.
Survey of Program Transformation TechnologiesChunhua Liao
This document provides an overview of program transformation techniques, including string-based transformations using scripting languages, compiler-based transformations through direct modification of intermediate representations, rule-based term rewriting, and semantic patching. It discusses challenges in applying program transformations at scale and the need for reusable transformation infrastructures. Example tools that apply different techniques are described, such as Stratego/XT for term rewriting and Coccinelle for semantic patching of C code.
This document provides an overview of Terraform including its key features and how to install, configure, and use Terraform to deploy infrastructure on AWS. It covers topics such as creating EC2 instances and other AWS resources with Terraform, using variables, outputs, and provisioners, implementing modules and workspaces, and managing the Terraform state.
The document discusses various topics related to multi-core programming in .NET including:
1) Concurrent collections like ConcurrentQueue and ConcurrentDictionary that are thread-safe for concurrent access from multiple threads.
2) Synchronization primitives like CountdownEvent, Barrier, and SemaphoreSlim for coordinating threads.
3) Techniques for improving performance like lazy initialization, limiting allocations, and optimizing for caches.
4) Important guidelines for using locks correctly and avoiding common multithreading bugs.
Memory Management & Garbage CollectionAbhishek Sur
The document discusses .NET memory management and garbage collection. It explains that memory is allocated on the managed heap for reference types using new. The garbage collector removes objects from the heap that are no longer referenced to free up memory. It compacts the heap during garbage collection to improve performance. While the garbage collector handles managed memory, it does not free unmanaged resources so classes use finalizers/destructors or implement IDisposable to release unmanaged resources.
Никита Корчагин - Programming Apple iOS with Objective-CDataArt
This document provides an overview of programming iOS apps with Objective-C, including how to get started, the Objective-C and Swift languages, Model-View-Controller (MVC) pattern, differences between desktop and mobile development, and human interface guidelines. Key topics covered include installing the necessary software, understanding core Objective-C concepts like classes, methods, and memory management, using view controllers and the MVC pattern to structure apps, and important considerations for mobile like limited resources and touch interfaces.
This document discusses parallel programming in .NET framework 4.0. It introduces parallel extensions, the task parallel library (TPL), tasks, and Parallel.For/Parallel.ForEach loops. It provides guidance on their proper usage, including ensuring thread safety when accessing shared resources from multiple threads and avoiding potential issues like deadlocks. PLINQ for parallel LINQ queries is also covered.
Avoid memory leaks using unit tests - Swift Delhi Meetup - Chapter 15Raunak Talwar
Slides used in swift delhi meetup chapter 15 at Kite HQ.
Here I've talked about how iOS does its memory management and then problem of reatin cycle and a solution to avoid this through unit tests.
Visual Studio 2010 and the .NET Framework 4 enhance support for parallel programming by providing a new runtime, new class library types, and new diagnostic tools. This presentation is all about parallel programming and its features.
Run Cloud Native MySQL NDB Cluster in KubernetesBernd Ocklin
The more your database aligns with Cloud Native principles such as resilience, scaling, auto-healing and data consistency across all nodes, the better it also runs as DBaaS in Kubernetes. I walk through running databases in Kubernetes and demos manual deployment and deployment with an NDB operator.
This talk was given at the MySQL Dev Room FOSDEM 2021.
For More information, refer to Java EE 7 performance tuning and optimization book:
The book is published by Packt Publishing:
http://www.packtpub.com/java-ee-7-performance-tuning-and-optimization/book
Mock what? What Mock?Learn What is Mocking, and how to use Mocking with ColdFusion testing, development, and continuous integration. Look at Mocking and Stubbing with a touch of Theory and a lot of Examples, including what you could test, and what you should test… and what you shouldn't test (but might be fun).
JavaScript and popular programming paradigms (OOP, AOP, FP, DSL). Overview of the language to see what tools we can leverage to reduce complexity of our projects.
This part goes over language features and looks at OOP and AOP with JavaScript.
The presentation was delivered at ClubAJAX on 2/2/2010.
Blog post: http://lazutkin.com/blog/2010/feb/5/exciting-js-1/
Continued in Part II: http://www.slideshare.net/elazutkin/exciting-javascript-part-ii
Distributed Tensorflow with Kubernetes - data2day - Jakob KaralusJakob Karalus
This document discusses using Distributed Tensorflow with Kubernetes for training neural networks. It covers:
- The need for distributed training to handle large datasets, deep models, and high accuracy requirements.
- Kubernetes as an orchestration tool for scheduling Tensorflow across nodes with GPUs.
- Key concepts like parameter servers, worker replicas, and synchronous/asynchronous training modes.
- Steps for setting up distributed Tensorflow jobs on Kubernetes including defining the cluster, assigning operations, creating training sessions, and packaging into containers.
- Considerations for enabling GPUs, building Docker images, writing deployments, and automating with tools like the Tensorflow Operator.
The document discusses the benefits of moving JIT compilation out of individual JVMs and into a shared, cloud-based compiler service. This "JIT-as-a-Service" approach improves efficiency by allowing optimization resources to be shared and elastic across JVMs. It also enables optimized code to be reused for applications that execute on multiple devices. Moving JIT compilation to the cloud reduces warmup time, memory footprint, and CPU usage for JVMs while improving the level of optimizations that can be performed.
The document discusses the HotRuby project, which aims to explore a server virtual machine (VM) for Ruby based on the Java VM. Some key points:
- HotRuby aims to take advantage of how the JVM optimizes programs through adaptive optimizations and allowing longer runtime to optimize.
- It uses an interpreter initially and then compiles code once the program definition is known, similar to other just-in-time VMs.
- The implementation focuses on reducing memory usage and object churn through techniques like using Java locals and specializing compiled code for receiver types.
- Initial performance results show HotRuby running at around 2.5 times faster than YARV, though it does not yet support all
Efficient Memory and Thread Management in Highly Parallel Java Applicationspkoza
This presentation discusses strategies to estimate and control the memory use of multi-threaded java applications. It includes a quick overview of how the JVM uses memory, followed by techniques to estimate the memory usage of various types of objects during testing. This knowledge is then used as the basis for a runtime scheme to estimate and control the memory use of multiple threads. The final part of the presentation describes how to implement robust handling for unchecked exceptions, especially Out Of Memory (OOM) errors, and how to ensure threads stop properly when unexpected events occur.
Aim of this presentation is not to make you masters in Java 8 Concurrency, but to help you guide towards that goal. Sometimes it helps just to know that there is some API that might be suitable for a particular situation. Make use of the pointers given to search more and learn more on those topics. Refer to books, Java API Documentation, Blogs etc. to learn more. Examples and demos for all cases discussed will be added to my blog www.javajee.com.
The document discusses using the Hyperloglog algorithm and Redis to approximately count unique items in a dataset in a space-efficient way. Some key points:
- Hyperloglog is an algorithm that estimates the size of a set in a space-efficient manner, sacrificing some accuracy.
- It provides a similar interface to a set but uses much less space (around 12kb) while maintaining the same time complexity.
- Redis implements Hyperloglog which allows approximating uniques across programming languages and persisting counts to the Redis key-value store in a space-efficient way.
This document discusses tools and techniques for optimizing Ruby performance. It begins by looking at common expensive tasks like database operations, network access, and inefficient algorithms. It then discusses tools for benchmarking and profiling Ruby code like Benchmark, benchmark-ips, and stackprof. The document provides examples of optimizing ActiveRecord queries and using caching and memoization. It also discusses optimizing the environment through server, database, and caching configuration. Finally, it notes that in some CPU-intensive or async tasks, Ruby may not be the best tool.
Using Groovy? Got lots of stuff to do at the same time? Then you need to take a look at GPars (“Jeepers!”), a library providing support for concurrency and parallelism in Groovy. GPars brings powerful concurrency models from other languages to Groovy and makes them easy to use with custom DSLs:
- Actors (Erlang and Scala)
- Dataflow (Io)
- Fork/join (Java)
- Agent (Clojure agents)
In addition to this support, GPars integrates with standard Groovy frameworks like Grails and Griffon.
Background, comparisons to other languages, and motivating examples will be given for the major GPars features.
The document discusses design patterns and their history. It mentions that design patterns were first documented by Christopher Alexander in the 1970s and later defined by the "Gang of Four" (GoF) in their 1994 book Design Patterns: Elements of Reusable Object-Oriented Software. The document then provides descriptions of what a design pattern is, why they are used, their different purposes (creational, structural, behavioral), and scope (class vs object level). It also includes brief summaries of some specific design patterns like Singleton, Factory Method, Abstract Factory, Builder, Prototype, Facade, Proxy, Adapter, and Bridge.
Geant4 Model Testing Framework: From PAW to ROOTRoman Atachiants
Roman Atachiants developed a framework to test Geant4 models that translates macros from PAW (Physics Analysis Workstation) to ROOT. The framework builds a unified database for model testing and allows comparing data points from experiments to simulation curves. It includes ROOT libraries, Geant4 test programs, and helpers for simulation, analysis, and plotting. The port from PAW to ROOT provides more comprehensive statistical analysis capabilities and allows obtaining better comparison results with larger statistics.
The document summarizes a CERN summer student project to convert Geant4 Monte Carlo model testing tools from PAW to ROOT and create a database and analysis tools. Key accomplishments included:
1) Converting 3000+ lines of code from PAW macros to ROOT and porting all tests, which increased code length by 40% but allowed larger simulations.
2) Developing tools for creating an experimental database from data, running simulations, and analyzing results with automatic scaling and formatting of output.
3) Creating a database structure and classes to store experimental publications and simulation results in ROOT files for flexible analysis of Geant4 models.
Research: Applying Various DSP-Related Techniques for Robust Recognition of A...Roman Atachiants
This paper approaches speaker recognition in a new way. A speaker recognition system has been realized that works on adult and child speakers, both male and female. Furthermore, the system employs text-dependent and text-independent algorithms, which makes robust speaker recognition possible in many applications. Single-speaker classication is achieved by age/sex pre-classication and is implemented using classic text-dependent techniques, as well as a novel technology for text-independent recognition. This new research uses Evolutionary Stable Strategies to model human speech and allows speaker recognition by analyzing just one vowel.
Research: Developing an Interactive Web Information Retrieval and Visualizati...Roman Atachiants
The document describes developing an interactive web information retrieval and visualization system. The system aims to make information searching and presentation easier and more efficient. It does this through speech recognition, keyword extraction from text, query construction and expansion using concepts, filtering and summarizing search results, and visualization. The system architecture includes these main components and was tested with satisfactory results. However, some challenges remain in creating a smooth presentation experience.
Master Thesis: The Design of a Rich Internet Application for Exploratory Sear...Roman Atachiants
Users who cannot formulate a precise query but know there must be a good answer somewhere, often rely on exploratory search. This requires an interactive and responsive system, or else the user will soon give up. As data bases are becoming larger, more specialized, and more distributed this calls for a Rich Internet Application, fast enough to keep pace with the users explorations. This thesis studies and implements a system, called MultiMap, which computes similarity maps in real-time. This entailed: (1) precomputing every data structure that does not change after the initial query, (2) optimizing algorithms for zooming and map generation (3) and providing a cognitively appropriate visualization of high dimensional space. Applied to a very large movie database, it resulted in a highly responsive, satisfying, usable system.
Pushing the limits of ePRTC: 100ns holdover for 100 daysAdtran
At WSTS 2024, Alon Stern explored the topic of parametric holdover and explained how recent research findings can be implemented in real-world PNT networks to achieve 100 nanoseconds of accuracy for up to 100 days.
TrustArc Webinar - 2024 Global Privacy SurveyTrustArc
How does your privacy program stack up against your peers? What challenges are privacy teams tackling and prioritizing in 2024?
In the fifth annual Global Privacy Benchmarks Survey, we asked over 1,800 global privacy professionals and business executives to share their perspectives on the current state of privacy inside and outside of their organizations. This year’s report focused on emerging areas of importance for privacy and compliance professionals, including considerations and implications of Artificial Intelligence (AI) technologies, building brand trust, and different approaches for achieving higher privacy competence scores.
See how organizational priorities and strategic approaches to data security and privacy are evolving around the globe.
This webinar will review:
- The top 10 privacy insights from the fifth annual Global Privacy Benchmarks Survey
- The top challenges for privacy leaders, practitioners, and organizations in 2024
- Key themes to consider in developing and maintaining your privacy program
Generative AI Deep Dive: Advancing from Proof of Concept to ProductionAggregage
Join Maher Hanafi, VP of Engineering at Betterworks, in this new session where he'll share a practical framework to transform Gen AI prototypes into impactful products! He'll delve into the complexities of data collection and management, model selection and optimization, and ensuring security, scalability, and responsible use.
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdfPaige Cruz
Monitoring and observability aren’t traditionally found in software curriculums and many of us cobble this knowledge together from whatever vendor or ecosystem we were first introduced to and whatever is a part of your current company’s observability stack.
While the dev and ops silo continues to crumble….many organizations still relegate monitoring & observability as the purview of ops, infra and SRE teams. This is a mistake - achieving a highly observable system requires collaboration up and down the stack.
I, a former op, would like to extend an invitation to all application developers to join the observability party will share these foundational concepts to build on:
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!SOFTTECHHUB
As the digital landscape continually evolves, operating systems play a critical role in shaping user experiences and productivity. The launch of Nitrux Linux 3.5.0 marks a significant milestone, offering a robust alternative to traditional systems such as Windows 11. This article delves into the essence of Nitrux Linux 3.5.0, exploring its unique features, advantages, and how it stands as a compelling choice for both casual users and tech enthusiasts.
“An Outlook of the Ongoing and Future Relationship between Blockchain Technologies and Process-aware Information Systems.” Invited talk at the joint workshop on Blockchain for Information Systems (BC4IS) and Blockchain for Trusted Data Sharing (B4TDS), co-located with with the 36th International Conference on Advanced Information Systems Engineering (CAiSE), 3 June 2024, Limassol, Cyprus.
In his public lecture, Christian Timmerer provides insights into the fascinating history of video streaming, starting from its humble beginnings before YouTube to the groundbreaking technologies that now dominate platforms like Netflix and ORF ON. Timmerer also presents provocative contributions of his own that have significantly influenced the industry. He concludes by looking at future challenges and invites the audience to join in a discussion.
Unlocking Productivity: Leveraging the Potential of Copilot in Microsoft 365, a presentation by Christoforos Vlachos, Senior Solutions Manager – Modern Workplace, Uni Systems
Introducing Milvus Lite: Easy-to-Install, Easy-to-Use vector database for you...Zilliz
Join us to introduce Milvus Lite, a vector database that can run on notebooks and laptops, share the same API with Milvus, and integrate with every popular GenAI framework. This webinar is perfect for developers seeking easy-to-use, well-integrated vector databases for their GenAI apps.
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdfMalak Abu Hammad
Discover how MongoDB Atlas and vector search technology can revolutionize your application's search capabilities. This comprehensive presentation covers:
* What is Vector Search?
* Importance and benefits of vector search
* Practical use cases across various industries
* Step-by-step implementation guide
* Live demos with code snippets
* Enhancing LLM capabilities with vector search
* Best practices and optimization strategies
Perfect for developers, AI enthusiasts, and tech leaders. Learn how to leverage MongoDB Atlas to deliver highly relevant, context-aware search results, transforming your data retrieval process. Stay ahead in tech innovation and maximize the potential of your applications.
#MongoDB #VectorSearch #AI #SemanticSearch #TechInnovation #DataScience #LLM #MachineLearning #SearchTechnology
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slackshyamraj55
Discover the seamless integration of RPA (Robotic Process Automation), COMPOSER, and APM with AWS IDP enhanced with Slack notifications. Explore how these technologies converge to streamline workflows, optimize performance, and ensure secure access, all while leveraging the power of AWS IDP and real-time communication via Slack notifications.
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024Neo4j
Neha Bajwa, Vice President of Product Marketing, Neo4j
Join us as we explore breakthrough innovations enabled by interconnected data and AI. Discover firsthand how organizations use relationships in data to uncover contextual insights and solve our most pressing challenges – from optimizing supply chains, detecting fraud, and improving customer experiences to accelerating drug discoveries.
Removing Uninteresting Bytes in Software FuzzingAftab Hussain
Imagine a world where software fuzzing, the process of mutating bytes in test seeds to uncover hidden and erroneous program behaviors, becomes faster and more effective. A lot depends on the initial seeds, which can significantly dictate the trajectory of a fuzzing campaign, particularly in terms of how long it takes to uncover interesting behaviour in your code. We introduce DIAR, a technique designed to speedup fuzzing campaigns by pinpointing and eliminating those uninteresting bytes in the seeds. Picture this: instead of wasting valuable resources on meaningless mutations in large, bloated seeds, DIAR removes the unnecessary bytes, streamlining the entire process.
In this work, we equipped AFL, a popular fuzzer, with DIAR and examined two critical Linux libraries -- Libxml's xmllint, a tool for parsing xml documents, and Binutil's readelf, an essential debugging and security analysis command-line tool used to display detailed information about ELF (Executable and Linkable Format). Our preliminary results show that AFL+DIAR does not only discover new paths more quickly but also achieves higher coverage overall. This work thus showcases how starting with lean and optimized seeds can lead to faster, more comprehensive fuzzing campaigns -- and DIAR helps you find such seeds.
- These are slides of the talk given at IEEE International Conference on Software Testing Verification and Validation Workshop, ICSTW 2022.
8. GC
• The .NET Framework uses automatic garbage collection to
manage memory for all applications.
Memory for an
Object’s object is
memory is freed allocated from
(collected) the managed
some time later heap when you
call new
Object dies tu to
all its references
Object
either being
constructor is
explicitly set to
called
null or going out
of scope
Object is used
for some time
9. Assemblies
• Prefer single large assemblies rather than multiple smaller
assemblies
• Overhead:
o The cost of loading metadata for smaller assemblies
o Touching various memory pages in pre-compiled images in the CLR in order to load
the assembly (Ngen)
o JIT compile time
o Security checks
• Sometimes you cannot avoid splitting assemblies; for
example, for versioning and deployment reasons. If you
need to ship types separately, you may need separate
assemblies.
10. Memory
• Allocation:
o Is super fast!
• Free:
o Is super slow!
• You want to avoid freeing memory. The easiest way to do
so is not to allocate in the first place.
11. Reuse Memory
• Do not use a new in a loop
for (int i = 0; i < 100; ++i) unless you really need to.
{
var numbers = new int[10];
// (...) Do something with numbers
Console.WriteLine(numbers.Sum());
}
var numbers = new int[10];
for (int i = 0; i < 100; ++i)
{
// (...) Do something with numbers
Console.WriteLine(numbers.Sum());
}
12. Object Pools
public sealed class ScriptBuilder : RecyclableObject • Object Pooling is
{
... something that tries to
}
keep a pool of objects in
public sealed class ScriptBuilderPool : memory to be re-used
ConcurrentPool<ScriptBuilder>
{ later and hence it will
public static readonly ScriptBuilderPool Default =
new ScriptBuilderPool(); reduce the load of object
public ScriptBuilderPool() :
creation to a great extent
base("ScriptBuilders", _ => new ScriptBuilder()){ }
} • Object Pool is nothing but
using (var obj = ScriptBuilderPool.Default.Acquire()) a container of objects
{
// Do stuff
that are ready for use
}
13. Class Design
• Do not make classes thread safe by default.
• Consider using the sealed keyword.
• Consider the tradeoffs of virtual members.
• Consider using overloaded methods.
• Consider overriding the Equals method for value types.
• Know the cost of accessing a property.
• Consider private vs. public member variables.
• Limit the use of volatile fields.
14. Class vs Struct
• Class
o A reference type
o Lives in the heap
o Slower
• Struct
o A value type
o Lives in the stack
o Faster
• … But, never use structs that are bigger than 16 bytes. Use
them wisely.
15. Threads
• Thread threads as a shared resource
o Do not create threads on a per-request basis because this can severely impact
scalability. Creating new threads is also a fairly expensive operation that should be
minimized. Treat threads as a shared resource and use the optimized .NET thread
pool.
• Locking is slow, avoid locking large portions of code
• Minimize thread creation
• Use the thread pool when you need threads
• Use a timer to schedule periodic tasks
• Never use Thread.Abort
• Never use Thread.Suspend or Thread.Resume
16. Flow & Control
“It is practically impossible to teach good programming style to students
that have had prior exposure to BASIC. As potential programmers, they are
mentally mutilated beyond hope of regeneration.”
E. W. Dijkstra
17. For vs For..Each
• For and for .. each loops
foreach(var item in List)
are different:
{ o For each is less performant than a
// do something with item for loop
}
o For each creates garbage
int count = List.Length;
• Always prefer for loops for
for(int i=0; i < count; ++i)
{
critical code
var item = List[i];
// do something with item • Any idea why?
}
18. Switch vs If
Matching Non-
• A switch statement
Matching compiles to a different set
of instructions and
Switch 15,7 sec 0,0 sec optimized for fast state-
Statement
machines.
If 20,7 sec 0,1 sec
Statement • Because each case within a
switch statement does not
rely on earlier cases, the
compiler is able to re-order
the testing in such a way as
to provide the fastest
execution.
Reference: http://www.blackwasp.co.uk/SpeedTestIfElseSwitch_2.aspx
19. Exceptions
for (int i=0; i < 5000000; i++) • When an exception is
{ thrown, your application dies
try
{ a little bit
throw new ApplicationException();
} • Never throw exceptions in
catch (ApplicationException) order to control the flow of
{
} the application
}
• However, do not use error
codes because of concerns
that exceptions might affect
Total time taken: 00:00:42.0312500 performance negatively
Exceptions per millisecond: 118
• Consider using TryParse()
pattern
Reference: http://www.developerfusion.com/article/5250/exceptions-and-performance-in-net/
20. Data Structures
“Most software today is very much like an Egyptian pyramid with millions of
bricks piled on top of each other, with no structural integrity, but just done
by brute force and thousands of slaves.”
Alan Kay
21. Strings
string BadConcatenate(string[] items)
• C# strings are immutable
string strRet = string.Empty;
foreach(string item in items) • Prefer String.Concat() to
{
strRet += item; String.Format()
}
return strRet; • StringBuilder is the only
}
way to have mutable
string GoodConcatenate(string[] items) strings, but still creates
{
var builder = new StringBuilder();
some garbage.
foreach(string item in items)
{
builder.Append(item);
}
return builder.ToString();
}
22. Collections
• Use the right type of the collection for your work
• Stop using List<T> for everything
• Ask yourself:
o Do you need to sort your collection?
o Do you need to search your collection?
o Do you need to access each element by index?
o Do you need a custom collection?
23. Collections
• Use the right type of the collection for your work
• Stop using List<T> for everything
• Ask yourself:
o Do you need to sort your collection?
• List<T> to bind read-only sorted data
• NameValueCollection for sorting strings
• SortedList<K,V> presorts while constructing
o Do you need to search your collection?
• Use Dictionary<K, V>
o Do you need to access each element by index?
• Use List<T>, Dictionary<K,V>, SortedList<K,V>
o Do you need a custom collection?
• Ask me, you probably don’t need it.
24. Arrays
// 2D array of 100 x 100 elements.
for (int a = 0; a < 100; a++) • Multidimensional Arrays [,]
{
for (int x = 0; x < 100; x++)
are slow.
{
int c = a1[a, x];
• Prefer jagged [][] arrays.
}
} • Arrays have a static size.
The size of the array
// Jagged array of 100 x 100
elements. remains fixed after initial
for (int a = 0; a < 100; a++)
{
allocation.
for (int x = 0; x < 100; x++)
{
int c = a2[a][x]; 2D array looping: 4571 ms
} Jagged array looping: 2864 ms [faster]
}
Reference: http://www.dotnetperls.com/regex-performance
25. RegEx
static Regex wordRegex = new • A regular expression is
Regex(@"W+", RegexOptions.Compiled);
essentially a state machine
static void Main()
{ • Always use
string s = "This is a simple /string/
for Regex.";
RegexOptions.Compiled if
string[] c = wordRegex.Split(s); you plan to reuse a regular
foreach (string m in c)
{ expression
Console.WriteLine(m);
} • RegexOptions.Compiled
}
takes 10x longer to
startup, but yields 30%
better runtime.
Reference: http://www.dotnetperls.com/regex-performance
27. Inline
• You want the compiler
to inline methods
public class MyClass{
protected virtual void SomeMethod() • Mark them as sealed
{ ... }
} • This code ends the chain
public class DerivedClass : MyClass {
of virtual overrides and
protected override sealed void makes DerivedClass.
SomeMethod () { ... }
} SomeMethod a
candidate for inlining
28. Copying Buffers
int[] arr1 = new int[] { 1, 2, 3, 4, 5 };
int[] arr2 = new int[10]; • Never copy buffers with a
// Copy the first twenty bytes from
loop, prefer
arr1 to arr2 Buffer.BlockCopy() or
Buffer.BlockCopy(arr1, 0, arr2, 0,
5 * sizeof(int) Array.Copy()
);
29. Recursion
private void RecursiveDir(string currentDir)
{ • Avoid recursion
foreach (var sin Directory.GetDirectories(dir))
RecursiveDir(s); • Most of the
foreach (var file in Directory.GetFiles(dir))
Console.WriteLine(file);
recursion can be
} converted to a tail-
private void IterativeDir(string startingDir) recursion
{
Stack stackFrame = new Stack(); • A tail-recursion is a
stackFrame.Push(startingDir);
while (stackFrame.Count > 0) simple loop
{
var current = (string) stackFrame.Pop();
foreach (var sin Directory.GetDirectories(current ))
stackFrame.Push(s);
foreach (var file in Directory.GetFiles(current))
Console.WriteLine(file);
}
}
30. More Tips (1)
• LINQ is slow, never use it if you need performance
• Never use reflection if you need performance
• Keep IO Buffer Size Between 4KB and 8KB
• Always use Asynchronous IO (Uses IOCP on Windows)
• ASP.NET: cache aggressively
• ASP.NET: use session state only if you need to
• ASP.NET: remove unnecessary HttpModules
• Experiment!
31. More Tips (2)
• Reduce boundary crossings (Unmanaged/Managed, Cross
Process, Cross AppDomain)
• Prefer single large assemblies
• Never use GC.Collect() unless you know what you are doing
• Do not implement Finalize unless required