In this presentation, you’ll learn preferred architecture patterns and practical steps for building your apps to be fast and responsive. Michael Samarin, Paul Houghton, Timo Saarinen of Futurice, show the results of various Series 40 code fragments and reveal where to spend your time in making improvements. They show you the differences that best-practice micro-optimisations make, where these optimisations are useful, and where you should let the tools and processor optimise for you.
JS Fest 2019. Александр Хотемский. Способы распараллеливания тестов в JavaScriptJSFestUA
This document discusses various ways to parallelize tests in JavaScript, including:
1. Concurrent execution by taking advantage of asynchronous code to run multiple tests simultaneously.
2. Parallelism using Node.js processes by distributing test files across multiple processes.
3. Parallelism using worker threads enabled in Node.js to run tests concurrently in separate threads.
4. Potential approaches using Functions as a Service (FaaS) or isolates to parallelize tests across isolated environments.
The document compares the approaches in terms of performance, resource usage, isolation, and support from test frameworks. It recommends worker threads as a promising approach being adopted by test frameworks.
This document discusses strategies for improving the performance of a Drupal 7 site. It begins by identifying common problems that can cause performance issues, such as server bottlenecks or inefficient database queries. When the problem is too many page requests, solutions like caching and the Cache Control module are proposed. For sites with frequently updating user-generated content, pulling content into a new fast cache layer with JSON and front-end theming is suggested. The document acknowledges that Drupal 7 requires extensions like these to achieve high performance and looks forward to performance improvements in Drupal 8.
The document discusses various Java Development Kit (JDK) tools for performance diagnostics including VisualVM, BTrace, jhat, and jmap. VisualVM is a visual tool that integrates command line JDK tools and can monitor memory, threads, take heap dumps, and profile CPU and memory. BTrace is a dynamic tracing tool that instruments Java programs at runtime. Jhat analyzes Java heap dumps and allows browsing object references. These tools help detect, analyze, and solve performance issues in Java applications.
Developing distributed analysis pipelines with shared community resources usi...Brad Chapman
The document describes using CloudBioLinux and CloudMan to develop distributed analysis pipelines with shared community resources. CloudBioLinux provides a shared machine image with bioinformatics software, while CloudMan enables setting up and managing compute clusters on Amazon Web Services, including sharing final results. An exome analysis pipeline is demonstrated running in parallel across the CloudMan cluster and extracting alignments, variant calls and summary information for reproducible research. Future interfaces are proposed to simplify file selection, parameters and integration with Galaxy for analysis.
This document discusses using web browsers and JavaScript for distributed evolutionary computation. It presents a framework where an evolutionary algorithm is run across multiple browser clients coordinated by a Ruby on Rails server. Experiments show scaling to larger problem sizes is limited by JavaScript performance in browsers and server load. Future work to address JavaScript optimization in browsers and offloading more work to clients could help improve the scalability of this browser-based distributed approach.
Slides from my Planning to Fail talk given at PHP North East conference 2013. This is a slightly longer version of the same talk given at the PHP UK conference. The talk was on how you can build resilient systems by embracing failure.
The document discusses operational efficiency hacks for systems operations. It provides examples of optimizations that can be made through software changes like upgrading versions or compilers, hardware changes by upgrading equipment, and reusing old hardware for offline tasks. Specific optimizations discussed include upgrading image processing software and compilers, performing diagonal scaling by replacing older servers with more powerful new ones, and using old servers for an offline queuing system. The overall message is that ongoing optimizations through both software and hardware changes can help systems do more work with fewer resources.
Autoscaled Distributed Automation using AWS at Selenium London MeetUparagavan
- The document discusses using Selenium Grid and AWS autoscaling (SeleniumGridScaler) to run UI tests in parallel across multiple machines, reducing test run time from hours to minutes.
- It provides information on setting up the Selenium Grid hub and nodes on AWS, making the grid stable through configuration tweaks, using different grid topologies, and saving costs through optimal node usage and batch processing.
- Reporting and dashboards are also discussed to provide failure trends, point-of-sale grids, and intelligent failure analysis.
In this presentation we will provide in-depth knowledge about the Unity runtime. The first part will focus on memory and how to deal with fragmentation and garbage collection. The second part on performance profiling and optimizations. Finally, there will be an overview of debugging and profiling improvements in the newly announced Unity 5.0.
This document is a slide deck presentation about high availability (HA) and distributed resource scheduler (DRS) gotchas that can negatively impact virtual infrastructure. It discusses common issues administrators encounter with vMotion capabilities as hardware is refreshed over time. It also explains how DRS and HA work together to optimize resource utilization and provide fault tolerance through automated workload balancing and live migration of virtual machines during host failures. The presentation emphasizes properly configuring clusters, resource pools, and rules to allow DRS and HA to fully leverage vMotion's capabilities.
Two popular tools for doing Machine Learning on top of JVM ecosystem is H2O and SparkML. This presentation compares these two tools as Machine Learning libraries (Didn't consider Spark's Data Munjing perspective). This work was done during June of 2018.
This presentation aims to demonstrate the importance of certain practices in Android Application Development to avoid annoying memory leaks which lead to fatal crash .
The document discusses optimizing performance for Ajax applications. It recommends:
- Keeping client-side code light by only requesting necessary data from the server via JSON messages.
- Avoiding unnecessary DOM touches and reflows which are computationally expensive.
- Measuring performance before and after optimizations to validate improvements rather than relying on intuition.
- Optimizing algorithms and avoiding unnecessary work rather than prematurely optimizing without evidence of need.
High Performance Ajax Applications 1197671494632682 2Niti Chotkaew
The document provides tips for developing high performance Ajax applications. It discusses planning for performance, measuring performance, optimizing page load speed, and optimizing JavaScript performance. Specific tips include making fewer HTTP requests, minifying assets, lazy-loading code, optimizing the initial rendering, reducing the amount of symbolic lookup in JavaScript, and optimizing regular expressions and string concatenation.
The document discusses techniques for optimizing JavaScript and AJAX performance. It recommends planning for performance from the start, measuring performance during development, reducing unnecessary code, optimizing assets, and handling long-running processes by breaking work into chunks. Specific tips include minimizing HTTP requests, leveraging caching, optimizing regular expressions, and using innerHTML for document modifications instead of DOM methods.
Memory management best practices in Android include using the sparse array family for collections below 1,000 items, avoiding unnecessary object creation, using StringBuilder for string concatenation, properly closing streams to prevent memory leaks, and using patterns like object pools and flyweights to reduce memory usage. The onTrimMemory callback and memory monitoring tools like Memory Monitor and Heap Viewer can help detect memory issues and leaks in an Android application.
Infrastructure as Code (IaC), how to choose the right tool, terraform vs. CDK vs. Pulumi, best practices, Principles, and a lot of the underlying principles are described in this crash course.
The document discusses several topics related to optimizing Java program performance including:
1. Using buffering and non-blocking I/O for file reading/writing to improve efficiency.
2. Minimizing network calls by retrieving related data in one call and using design patterns like the session facade.
3. Reusing objects when possible rather than constantly creating new instances to reduce garbage collection overhead.
Java in 2019 was predicted to be business as usual by many. We have seen new Java releases coming out as planned, AdoptOpenJDK became the main trustful source of binaries and Oracle fighting for the trademark again by preventing the use of javax as namespace. Everything looks like it would be a silent year for Java. But one thing seems obvious. Java's popularity is not gaining any more traction. New language features keep it up to date but people are getting more selective when it comes to implementation choices. Especially in the age of containers and cloud infrastructures. This talk walks you through the why and how of Java in containers. We will talk about image size and development and deployment processes.
Performance measurement methodology — Maksym Pugach | Elixir Evening Club 3Elixir Club
Доповідь Максима Пугача, Team Lead/Software Engineer at LITSLINK, на Elixir Evening Club 3, Kyiv, 13.12.2018
Наступна конференція - http://www.elixirkyiv.club/
A boss of mine once told me "Just see, my poorly written Vert.x app outperforms my poorly written Elixir app". Now it is time to take up the gauntlet.
Cлідкуйте за нами у соцмережах @ElixirClubUA та #ElixirClubUA
Анонси та матеріали конференцій - https://www.fb.me/ElixirClubUA
Новини - https://twitter.com/ElixirClubUA
Фото та невимушена атмосфера - https://www.instagram.com/ElixirClubUA
*Канал організаторів мітапа - https://t.me/incredevly
Java is finally elastic! OpenJDK improvements and new features in Garbage Collection technology resulted in enhancing Java vertical scaling and resource consumption. Now JVM can promptly return unused memory and, as result it can go up and down automatically. In this presentation, we cover the main achievements in vertical scaling direction, as well as share peculiarities and tuning details of different GCs. Find out how to make your Java environments more elastic to follow the load and lower down the total cost of ownership at a large scale.
Fast, concurrent ruby web applications with EventMachine and EM::SynchronyKyle Drake
This document summarizes Kyle Drake's presentation on using EventMachine (EM) and EM::Synchrony to build fast, concurrent Ruby web applications without blocking I/O or callback hell. Key points include:
- EM implements the reactor pattern to handle blocking I/O without threads by using callbacks and kernel threads.
- EM::Synchrony avoids callback nesting by wrapping callbacks in fibers, allowing synchronous-looking code.
- Sinatra can be made concurrent by running each request in its own EM::Synchrony fiber with little code change.
- Ruby has strong options for building high-performance concurrent apps while maintaining productivity advantages over Node.js.
Nobody likes to wait for web pages to load in the browser. The longer it takes, the more dissatisfied the users become. Slow web pages lead to a higher bounce rate and the loss of customers. To solve this kind of problems can be very hard sometimes. Before you even start to optimise your page, you have to understand the workflows a browser performs in order to display a page on the screen. In this talk you will get some insights in the critical rendering path and the javascript engine of your browser that help you to find performance problems and solve them. I will show you also some tools and best practices that make your life easier when it comes to performance.
Efficient Memory and Thread Management in Highly Parallel Java ApplicationsPhillip Koza
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.
node.js 실무 - node js in practice by Jesang YoonJesang Yoon
Sharing 4 years of experience about node.js - A google chrome V8 engine javascript based web server technology. This slide covers about wide range of knowledge about node.js learned from 4 years of production, experiment, test & failures
4년 동안 node.js 서버 프로그래밍을 경험한 내용을 간략하게 정리해 보았습니다. node.js 를 접하시는 분들에게 도움이 되었으면 합니다.
Find out how to configure and package clustered Payara Micro with load balancing, automatic scaling and dedicated storage for building cloud-native microservices. Then with the help of cloud scripting and triggering, automate CI/CD for the deployed application and emulate the load to check the scaling and performance results.
The document discusses three pillars of concurrency:
1) Responsiveness and isolation through using background threads to avoid blocking the main UI thread.
2) Throughput and scalability by distributing work across multiple threads to maximize all available CPU cores.
3) Consistency by dealing with shared memory access across threads to prevent race conditions and deadlocks, such as through immutable objects, message passing, and transactional memory.
Similar to Designing and coding Series 40 Java apps for high performance (20)
The document summarizes Nokia X platform 2.0, which provides an improved user experience over version 1.0. It is now compatible with Android 4.3 instead of 4.1. While the API offering remains mainly the same, ensuring compatibility of applications from version 1.0, there are new features like a control panel and ongoing tasks layer. The user interface also includes enhancements like a 4-column layout and separation of applications, widgets, and notifications.
This document discusses developing contextual app experiences and provides guidance on building apps that are aware of the user's current context. It notes that context-aware apps can provide more personalized and helpful experiences for users. The document is intended as an informational guide and Microsoft makes no guarantees about the accuracy of the information after its publication date. It also states that the examples provided are fictional.
Bring your ideas to life with the APIs and additional memory available for development on the Nokia Asha platform. Join this webinar to learn how much you can do in the area of imaging, with the Image Scaling API and the Image Processing API. You’ll also get detailed guidelines on how to work with the camerainterface and how to create special effects and filters.
Healthcare apps for Nokia X and Nokia Asha phones present a great opportunity to help improve the lives of millions of users around the world. In this webinar, we’ll discuss the fundamentals of mobile healthcare apps and give you an overview of the opportunities and challenges involved in developing such apps for Nokia phones. We’ll open the webinar with an introduction to the fundamentals of mobile healthcare, an overview of opportunities and challenges of developing apps for wellness and mobile health, and the role of mobile platforms in enabling health and healthcare apps. Then we will dig into specific techniques available when developing such apps for Nokia X and Nokia Asha platforms.We’ll demonstrate different approaches available to developers targeting the two platforms by examining a Blood Pressure Diary app, which is implemented for Nokia X and Nokia Asha. As part of that discussion we’ll show how to retrieve heart-rate data from medical devices using Bluetooth technology.
The Nokia Notifications API enables you to implement Push notifications in your Nokia X apps. Nokia Notifications consists of a client API and a server API. If you’re already using Google Cloud Messaging in an Android app, you can port or even add Nokia Notifications to the same code base and APK. In this webinar, we’ll show you how to use Nokia Notifications in your Nokia X apps and walk you through example code provided in the Nokia X SDK.
This document provides guidance on conducting DIY usability studies for Asha apps. It discusses fundamentals of usability testing, how to optimize tests, preparation steps, running a test session, analyzing outcomes, and available UX resources. Key recommendations include testing early and often with 2-3 participants, focusing on the biggest usability issues, and remembering that usability is about improvement rather than proof. The document aims to make usability testing accessible for independent developers.
Most Android apps run properly on the Nokia X platform without any modification, but maybe you’d like some help with improving the user experience of your apps as you port them to Nokia X. UX expert Jan Krebber, from OCTO3, has been working with developers porting to Nokia X and has seen patterns of mistakes that are easy to correct. In this webinar, he’ll share his top tips on how to avoid the most common missteps.
With the open source Geo2tag platform, developers can use JSON or XML to manage location references in apps for Nokia X and Nokia Asha phones. In this webinar, we’ll show how to use the Geo2tag API and how to manage a local database of georeferences. We’ll begin the training by introducing the fundamentals of Location Based Services and the REST API of Geo2Tag LBS Platform (www.geo2tag.org). We’ll focus on networking, JSON and web services. Then we will demonstrate several applications developed on top of Geo2Tagand share the newest enhancements to the platform. We’ll end the training with a discussion of integrating Geo2Tag and third-party map widgets.
With HERE Maps, users always know where they are and where they’re going, even when they’re not connected to a mobile network. In this webinar, we’ll show you how to integrate HERE Maps into your new apps for Nokia X and how to port existing apps.
Nokia In-App Payment is designed from the ground up to encourage users to spend more on your digital goods, let you keep more of what your users spend, and reach the broadest possible market around the world. If you’re not yet using Nokia In-App Payment to generate revenue from your Nokia applications, you should be. Join this webinar to find out how to optimise Nokia In-App Payment UI flows before and after payments occur. You’ll learn about tips and tricks to increase conversion rates and to avoid pitfalls and deal-breakers.
Nokia Theme API and Webview API are new additions in Nokia Asha SDK 1.2. The Theme API enables developers to change themes and to access the properties of a current theme. The Webview API is used to display web pages inside a MIDlet, enabling delivery of more-sophisticated Help, About, and other screens to users. In addition, Nokia Asha SDK 1.2 contains updates to the Contact API that allow MIDlets to receive notifications with social contacts in the phonebook are added, deleted, or modified. Pranav Gothadiya, lead developer and product owner for Nokia Asha SDKs, starts this training webinar with an overview of new and updated features in Nokia Asha SDK 1.2 and the new Nokia Asha software platform 1.4. Pranav then demonstrates code examples included in the SDK to illustrate the new Theme and Webview APIs. He also touches on the (Social) Contact API, as well as on SDK features that enable developers to support frame-positioning control and progressive audio recording.
Approximately 75% of Android apps run properly on Nokia X platform without any modification, but maybe you’d like some help improving the UX of your app as you port it to Nokia X. UX expert Jan Krebber will show you how to improve the UX of your Nokia X apps in terms you don’t need to be a UX expert to understand. He’ll focus on the few items most important when it comes to user experience design for Android and Nokia X.He’ll introduce those items and show you how to create a launcher icon for Nokia X.
Some children start using mobile devices at very young ages. Mobile phones can be very powerful tools to support learning and to nurture cognitive capabilities. This webinar addresses UI design considerations for creating games and educational applications for children and teens. Although the webinar focuses on Nokia Asha phones, the findings it examines hold true for mobile devices in general.
In this webinar we'll provide an overview of the Nokia X platform and product offering. Then we'll dig into monetization opportunities offered by Nokia In-app Payment combined with Nokia's extensive operator billing network. We'll show you how you can benefit by bringing your apps to Nokia Store, take advantage of it’s unique monetization capabilities and make your app stand out from the crowd.
The Nokia Imaging SDK 1.1 provides tools for image processing and effects for Windows Phone and Windows 8.1 applications. It includes over 50 filters and effects that can be combined in a processing pipeline. New features in version 1.1 include HDR effects, lens blur, and interactive foreground segmentation. The SDK allows loading images from various sources and outputting processed images as bitmaps or JPEG files. It provides a simple architecture based on image sources, effects, and renderers that can be combined flexibly to create custom image processing workflows.
Welcome to Nokia X Software Platform! In this webinar we’ll provide a detailed overview of Nokia X Software Platform and show you how to get started developing for it.In live demonstrations we’ll show how to install and configure your development environment and Nokia tools. You’ll learn similarities and differences of Nokia X compared with other development platforms and learn how easy it is to publish your existing Android app for Nokia X. We’ll show you how to test and port your app and explain the capabilities and specifics of Nokia APIs: Nokia Notification Service, In-App Payment and HERE Maps.
DVLUP members who want help with the design of their Windows Phone 8 app can redeem XP for one-hour online UI clinics delivered by the design pros at Toledo Design. This webinar is open to everyone, whether you're a member of DVLUP or not. Arturo Toledo, mobile design expert and former design evangelist and UX design in the Windows Phone design studio, has already delivered over 50 of these one-on-one consultations to help DVLUP members improve the design, usability, and user reviews of their applications. In this 1 hour webinar, Arturo shares some of the most common design challenges he has seen in these real-world consultations and shows how to fix them.
Microsoft Windows Phone ha un sistema di riconoscimento vocale molto sofisticato. Ci permette di impartire comandi al sistema operativo, leggere e dettare SMS, effettuare chiamate etc. In Windows Phone 8 è stata introdotta, per noi sviluppatori, la possibilità di utilizzare i comandi vocali anche nelle nostre applicazioni. In questa sessione vedremo come implementare il riconoscimento vocale nelle nostre app. / Microsoft Windows Phone has a very sophisticated speech-recognition system. Users can give commands to the operating system, read and dictate text messages, make phone calls, etc. With Windows Phone 8, developers have the ability to use voice commands in applications. In this webinar, you’ll find out how to implement voice recognition in your apps.
Lo sviluppo è sicuramente la parte più divertente nella creazione di un'applicazione, ma senza un meccanismo per venderle e distribuirle rimarrebbe un'attività fine a sé stessa. Nel corso di questo webinar vedremo come funziona il processo di pubblicazione di un'applicazione e impareremo a gestirne il ciclo di vita sullo Store: la certificazione, i report post pubblicazione, il rilascio di aggiornamenti.
Quando ci si trova nella necessità di sviluppare applicazioni per Microsoft Windows Phone più complesse, l'approccio tradizionale mostra qualche limite: non c'è una separazione tra i vari strati dell'applicazione e il codice è più difficile da testare e da mantenere. Questo webinar vi mostrerà le basi del pattern Model-View-ViewModel (MVVM), che offre un approccio più strutturato, in grado di separare la parte di logica dall'interfaccia grafica. / When you need to develop complex applications for Microsoft Windows Phone, the traditional approach shows some limitations. This webinar will show you the basics of Model-View-ViewModel (MVVM), which offers a more structured approach.
Blockchain technology is transforming industries and reshaping the way we conduct business, manage data, and secure transactions. Whether you're new to blockchain or looking to deepen your knowledge, our guidebook, "Blockchain for Dummies", is your ultimate resource.
How Social Media Hackers Help You to See Your Wife's Message.pdfHackersList
In the modern digital era, social media platforms have become integral to our daily lives. These platforms, including Facebook, Instagram, WhatsApp, and Snapchat, offer countless ways to connect, share, and communicate.
Best Programming Language for Civil EngineersAwais Yaseen
The integration of programming into civil engineering is transforming the industry. We can design complex infrastructure projects and analyse large datasets. Imagine revolutionizing the way we build our cities and infrastructure, all by the power of coding. Programming skills are no longer just a bonus—they’re a game changer in this era.
Technology is revolutionizing civil engineering by integrating advanced tools and techniques. Programming allows for the automation of repetitive tasks, enhancing the accuracy of designs, simulations, and analyses. With the advent of artificial intelligence and machine learning, engineers can now predict structural behaviors under various conditions, optimize material usage, and improve project planning.
RPA In Healthcare Benefits, Use Case, Trend And Challenges 2024.pptxSynapseIndia
Your comprehensive guide to RPA in healthcare for 2024. Explore the benefits, use cases, and emerging trends of robotic process automation. Understand the challenges and prepare for the future of healthcare automation
Advanced Techniques for Cyber Security Analysis and Anomaly DetectionBert Blevins
Cybersecurity is a major concern in today's connected digital world. Threats to organizations are constantly evolving and have the potential to compromise sensitive information, disrupt operations, and lead to significant financial losses. Traditional cybersecurity techniques often fall short against modern attackers. Therefore, advanced techniques for cyber security analysis and anomaly detection are essential for protecting digital assets. This blog explores these cutting-edge methods, providing a comprehensive overview of their application and importance.
Coordinate Systems in FME 101 - Webinar SlidesSafe Software
If you’ve ever had to analyze a map or GPS data, chances are you’ve encountered and even worked with coordinate systems. As historical data continually updates through GPS, understanding coordinate systems is increasingly crucial. However, not everyone knows why they exist or how to effectively use them for data-driven insights.
During this webinar, you’ll learn exactly what coordinate systems are and how you can use FME to maintain and transform your data’s coordinate systems in an easy-to-digest way, accurately representing the geographical space that it exists within. During this webinar, you will have the chance to:
- Enhance Your Understanding: Gain a clear overview of what coordinate systems are and their value
- Learn Practical Applications: Why we need datams and projections, plus units between coordinate systems
- Maximize with FME: Understand how FME handles coordinate systems, including a brief summary of the 3 main reprojectors
- Custom Coordinate Systems: Learn how to work with FME and coordinate systems beyond what is natively supported
- Look Ahead: Gain insights into where FME is headed with coordinate systems in the future
Don’t miss the opportunity to improve the value you receive from your coordinate system data, ultimately allowing you to streamline your data analysis and maximize your time. See you there!
Kief Morris rethinks the infrastructure code delivery lifecycle, advocating for a shift towards composable infrastructure systems. We should shift to designing around deployable components rather than code modules, use more useful levels of abstraction, and drive design and deployment from applications rather than bottom-up, monolithic architecture and delivery.
Fluttercon 2024: Showing that you care about security - OpenSSF Scorecards fo...Chris Swan
Have you noticed the OpenSSF Scorecard badges on the official Dart and Flutter repos? It's Google's way of showing that they care about security. Practices such as pinning dependencies, branch protection, required reviews, continuous integration tests etc. are measured to provide a score and accompanying badge.
You can do the same for your projects, and this presentation will show you how, with an emphasis on the unique challenges that come up when working with Dart and Flutter.
The session will provide a walkthrough of the steps involved in securing a first repository, and then what it takes to repeat that process across an organization with multiple repos. It will also look at the ongoing maintenance involved once scorecards have been implemented, and how aspects of that maintenance can be better automated to minimize toil.
Measuring the Impact of Network Latency at TwitterScyllaDB
Widya Salim and Victor Ma will outline the causal impact analysis, framework, and key learnings used to quantify the impact of reducing Twitter's network latency.
Choose our Linux Web Hosting for a seamless and successful online presencerajancomputerfbd
Our Linux Web Hosting plans offer unbeatable performance, security, and scalability, ensuring your website runs smoothly and efficiently.
Visit- https://onliveserver.com/linux-web-hosting/
Details of description part II: Describing images in practice - Tech Forum 2024BookNet Canada
This presentation explores the practical application of image description techniques. Familiar guidelines will be demonstrated in practice, and descriptions will be developed “live”! If you have learned a lot about the theory of image description techniques but want to feel more confident putting them into practice, this is the presentation for you. There will be useful, actionable information for everyone, whether you are working with authors, colleagues, alone, or leveraging AI as a collaborator.
Link to presentation recording and transcript: https://bnctechforum.ca/sessions/details-of-description-part-ii-describing-images-in-practice/
Presented by BookNet Canada on June 25, 2024, with support from the Department of Canadian Heritage.
Understanding Insider Security Threats: Types, Examples, Effects, and Mitigat...Bert Blevins
Today’s digitally connected world presents a wide range of security challenges for enterprises. Insider security threats are particularly noteworthy because they have the potential to cause significant harm. Unlike external threats, insider risks originate from within the company, making them more subtle and challenging to identify. This blog aims to provide a comprehensive understanding of insider security threats, including their types, examples, effects, and mitigation techniques.
Sustainability requires ingenuity and stewardship. Did you know Pigging Solutions pigging systems help you achieve your sustainable manufacturing goals AND provide rapid return on investment.
How? Our systems recover over 99% of product in transfer piping. Recovering trapped product from transfer lines that would otherwise become flush-waste, means you can increase batch yields and eliminate flush waste. From raw materials to finished product, if you can pump it, we can pig it.
20240704 QFM023 Engineering Leadership Reading List June 2024
Designing and coding Series 40 Java apps for high performance
1. Series 40 Developer Training Michael Samarin
Paul Houghton
Timo Saarinen
Designing and coding Series 40
Java apps for high performance Futurice Ltd
2. Today’s Topics
» Performance Basics on Series 40
» Mobile Front End Architecture Patterns
» Choosing GUI, Caching, Threading
» Low Level “Micro” Performance Optimization
3. Miller, R. B. (1968)
Response time in man-computer conversational
transactions.
Proc. AFIPS Fall Joint Computer ConferenceVol. 33, 267-277
» 0.1 second is about the limit for having the
user feel that the system is reacting
instantaneously, meaning that no special
feedback is necessary except to display the
result.
4. » 1.0 second is about the limit for the user's flow of
thought to stay uninterrupted, even though the user will
notice the delay. Normally, no special feedback is
necessary during delays of more than 0.1 but less than
1.0 second, but the user does lose the feeling of
operating directly on the data.
» 10 seconds is about the limit for keeping the user's
attention focused on the dialogue. For longer delays,
users will want to perform other tasks while waiting for
the computer to finish, so they should be given feedback
indicating when the computer expects to be done.
Feedback during the delay is especially important if the
response time is likely to be highly variable, since users
will then not know what to expect.
6. LCDUI Forms
» Fast, simple and standard way of making UI.
» On full touch Asha very attractive looking and have
huge UX improvements.
» Not as fast as Canvas. Animation on a Form is much
slower than on a Canvas, and there is no way to
influence the vertical scroll position, animate transitions
between screen, or shift to a full screen view. You can,
however, slightly increase the performance when
changing screens by using just one Form and re-
populating it with new Items.
» http://www.developer.nokia.com/Resources/Library/Full_Touch
7. Canvas
» Highly customizable way of making UI.
» You have to take care of render timing yourself, or you can use
Nokia’s FrameAnimator class to quickly create effects such as
kinetic scrolling.
» Any part of your code can call Canvas.repaint() to signal that
painting should occur soon.
» The most important performance tip for navigating through a
Canvas-based UI is to implement your own View class to
represent each screen, and paint all Views on one Canvas rather
than switching from one Canvas to another, which can be slow
and does not give you the possibility of animating the transition
for smooth effect.
8. GameCanvas
» GameCanvas is double buffered with more control over the
painting cycle and threading.
» Unlike Canvas, you should create your own Thread, which calls
GameCanvas.paint() directly to fill the graphics buffer, and then
GameCanvas.flushGraphics() to instantly blit the graphics buffer
onto the screen.
9. LWUIT
» LWUIT (Lightweight User Interface Toolkit) is a toolkit for
creating SWING-like applications without some of the complexity
of SWING.
» Like Form, it offers basic components, but it adds to this better
layouts, styles and theming, bundling own fonts into your
application, and animated screen transitions.
» LWUIT is implemented on top of a Canvas, but it is a large and
complex library written to be a general purpose replacement for
the default UI on many different phones.
» LWUIT and the associated themes and any fonts you include
quickly make your JAR file grow quite large.
» http://projects.developer.nokia.com/LWUIT_for_Series_40
10. Heap Memory
» On Series 40 only from 2 to 4 MB.
» Instances of classes (objects) and primitive types
are created in the heap.
» Total number of methods in classes loaded by JVM
has a direct impact on how much heap space is left
for other data. These memory allocations are
permanent for the runtime of the application and
are not dynamically unloaded by the JVM once a
class is no longer in use.
11. Recursive Algorithms and Stack Memory
» Variables passed as arguments to a method are passed on
the current thread’s stack. Method variables of primitive
types are also allocated on the stack.
» Recursive algorithms are algorithms where a method calls
itself in a loop to complete a task. As a result, they create
multiple stack frames.
› They use a lot of stack memory. The same method is called repeatedly, and only as the
application completes does it unwind the queued stack frames. This extra stack
memory is often not useful, and stack memory per thread is limited and such heavy
stack use may well cause an OutOfMemoryException well before you are actually out of
heap memory.
› Recursive algorithms can be slow. Each method call includes a certain amount of
overhead, which is not really necessary since a recursive algorithm can be unwound into
a non-recursive equivalent loop that does not include the relatively heavy method call.
12. › Provides basic “free”
optimization
› Fixes code redundancy and
pre-calculate things
Compile Time whenever possible
Optimization › Minimizes memory usage
and › Should be last step in
Obfuscation building apps – takes time
and makes debugging
difficult
› Doesn’t fix wrong
architecture
15. Obfuscation Example: Battle Tank
https://projects.developer.nokia.com/JMEBattleTank
› JAR File size decreased by 4%
(889 -> 852 kB)
› RAM usage decreased by 14%
(161 -> 138 kB)
16. Architecture changes
» Carefully consider architecture of your drawing loop and
input loops and decouple them whenever possible.
» Example: panorama drawing and sensor driving loop.
» Original example:
» http://www.youtube.com/watch?v=PfW4BVHgri8
» After optimization:
» http://www.youtube.com/watch?v=xSRYVYrNNMI
17. WeakReference object Caching
» Best pattern for using all available heap memory, but
never running into the dreaded OutOfMemoryError.
» CLDC 1.1 WeakReference
» When an object is referenced by a WeakReference, and not
using traditional Object pointers, this is a signal to the
garbage collector that is has permission to collect the
object if memory is running low.
» You have to maintain own HashTable of Objects
» To understand this pattern better look at Tantalum 3:
http://projects.developer.nokia.com/Tantalum
18. public class WeakHashCache {
protected final Hashtable hash = new Hashtable();
public Object get(final Object key) {
final WeakReference reference = (WeakReference) hash.get(key);
if (reference != null) {
return reference.get();
}
return null;
}
public void put(final Object key, final Object value) {
synchronized (hash) {
if (key == null) {
return;
}
if (value == null) {
hash.remove(key);
return;
}
hash.put(key, new WeakReference(value));
}
}
public void remove(final Object key) {
if (key != null) {
hash.remove(key);
}
}
public boolean containsKey(final Object key) {
if (key != null) {
return hash.containsKey(key);
}
return false;
}
public int size() {
return hash.size();
}
public void clear() {
hash.clear();
}
}
19. Render Caching
» One of the common performance needs is to make your
application paint, in particular scroll, smoothly and quickly.
» You can paint items each into their own Image, keeping
that pre-painted Image in a cache, and reusing it as the
object moves around the screen. Essentially,
WeakReference cach of pre-painted Images.
» Can achieve dramatic FPS increase, like in this example
from 3 to 12 on Asha 305:
» http://www.youtube.com/watch?v=Z2QcnhROFGc
» To understand this pattern better look at Tantalum 3:
http://projects.developer.nokia.com/Tantalum
20. File System (Flash Memory) Caching
» Flash memory is slow, but faster then Web.
» Cache downloaded data from previous session. Improve
startup time of app, by loading from disk cache instead of
new Web requests.
» RMS and File System (JSR-75) same speed, but with RMS
no security prompts.
» Can achieve dramatic startup time decrease, like in this
example from 10 to 2 seconds on Asha 305:
» http://www.youtube.com/watch?v=Cn96lET4moU
21. File System (Flash Memory) Caching
» Underwater stones: still remember, Flash memory is slow.
» Architect your application to use asynchronous loading
/saving of data from / to disk cache.
» In Battle Tank example, it was possible to save 28ms in
each rendered frame, by removing synchronous references
to flash memory in loop.
» To understand this pattern better look at Tantalum 3:
http://projects.developer.nokia.com/Tantalum
22. Hash Acceleration
» Some iterative algorithms are slow. Proper usage of
collections types of data structures can increase
performance.
» Vector.contains() is very slow, but Hashtable.containsKey() is
very fast. Reconsider your algorithms to use Hashtables.
» Usage can be found in very surprising places. For example,
Font.stringWidth() is slow, but necessary for drawing
multiline text on Canvas. Creating a Hashtable with the
width in each character you have used in the Font can
transform this into a fast operation and increase
Canvas.paint() speed.
23. Synchronized vs. Volatile Variables
» When a variable or Object needs to be accessed from more
than one Thread.
» Marking a variable as volatile is the least restrictive
approach and can have very high performance because no
Thread is blocked.
» Only one Thread may enter the synchronized sections at
any one time.
» Consider atomic operations on two variables. For example, when
updating firstName and lastName from “John Smith” to “Jane
Marceau”, do so within a synchronized block to avoid briefly exposing
the transitional state “Jane Smith” to other threads.
24. Constants
» We can give the compiler and Proguard more opportunities
to optimize the code at the compile step, and this will also
give the ARM processor opportunities for handling these
variables with more efficient byte codes.
private static int loopCount = 10;
private static long startTime = System.currentTimeMillis();
private static boolean enableImages = true;
Should be
private static final int LOOP_COUNT = 10;
private static final long START_TIME = System.currentTimeMillis();
private static final boolean ENABLE_IMAGES = true;
25. Primitives
» Use int instead of short, byte or long.
for (int i = 0; i < 3000000; i++) {
short/int/long a = 123;
short/int/long b = -44;
short/int/long c = 12;
a += c;
b += a;
c *= b;
}
Average times spent in loops on Nokia Asha 305 (obfuscated):
int: 710 (580) ms
short: 900 (850) ms 50% slower
long: 1450 (1150) ms 100% slower
26. Final in methods
for (int i = 0; i < 1000000; i++) {
a = finalMethod(1, 2, 3);
}
for (int i = 0; i < 1000000; i++) {
a = nonFinalMethod(1, 2, 3);
}
public final int finalMethod(final int a, final int b, final int c) {
final float x = 1.23f, y = 0.05f;
final float z = x * y;
final int d = a + b + c;
return d;
}
public int nonFinalMethod(int a, int b, int c) {
float x = 1.23f, y = 0.05f;
float z = x * y;
int d = a + b + c;
return d;
}
27. Final in methods
Average times on a Nokia Asha 305:
finalMethod: 650 ms
nonFinalMethod: 940 ms 45% slower
In this case, the time difference comes from final keyword before
x and y. It is logical because then z value can be precalculated.
The final keywords with parameters a, b, c let us not precalculate
d or anything. And because we don’t use z, it being final does not
help us
28. Static
» Generally static methods and variables should be faster.
Oddly, with some combinations of ARM and JVM, instance
accesses are slightly faster.
for (int i = 0; i < 1000000; i++) {
staticMethod();
Average times spent in loops
} on Nokia Asha 305
for (int i = 0; i < 1000000; i++) {
nonStaticMethod();
(obfuscated):
}
private static void staticMethod() { nonStaticMethod: 570 ms
b++; // static variable
} staticMethod: 680 ms 20%
private void nonStaticMethod() { slower
a++; // instance variable
}
29. String Concatenation
If you are going to concatenate a large number of small Strings,
use:
StringBuffer.append()
instead of the
String +=
operator. String is much slower because every time you
concatenate a string to another with += operator, a new
StringBuffer is created under the hood. Depending on the number
of concatenations, a single explicit StringBuffer can be many times
faster than multiple implicit StringBuffers created by String
addition.
30. Addition vs. Multiplication vs. Division
for (int i = 0; i < 500000; i++) {
a = 1.23f;
b = 1.45f;
c = 0.004523f;
c += a;
a = b + c;
}
for (int i = 0; i < 500000; i++) {
Average times spent in loops
a = 1.23f;
b = 1.45f;
on Nokia Asha 305:
c = 0.004523f;
c *= a; Multiplying: 330 ms
a = b * c;
} Addition: 360 ms 9% slower
for (int i = 0; i < 500000; i++) {
a = 1.23f; Division: 560 ms 70% slower
b = 1.45f;
c = 0.004523f;
c /= a;
a = b / c;
}
31. Switch vs. If
The switch statement in C is implemented as a direct jump which is
extremely fast. In Java on Nokia Series 40 phones, switches are
implemented at the bytecode level as a series of if statements.
Therefore in many cases a switch statement is less efficient than a
manually created series of if..else statements in which the first
positive case is selected as the one which occurs more frequently. If
you prefer to use switch statements for code clarity, then arrange
them so that the most frequent cases appear first.
32. Hidden References
» All inner classes contain a reference to the parent class.
Even if your code does not take advantage of this, if you
pass an inner class to an execution queue such as the event
dispatch thread (EDT), the parent class cannot be garbage
collected until the inner class instance has been executed
and can be garbage collected.
MyCanvas:
midlet.getDisplay().callSerially(new Runnable() {
public void run() {
System.out.println(“Canvas width: “ +
MyCanvas.this.getWidth());
}
});
33. Performance summary
» Compare Algorithms
› Talk to colleagues and pick the best algorithm; having
the best possible algorithm is the most effective way to
optimize performance.
» Simple Architecture
› Keep your architecture simple and to the point without
extra layers of method calls or objects for artificial
abstraction. Mobile front end code does not last for
ever, so over-engineering and excessive abstraction into
multiple classes will slow you down compared to simple
use of variables.
34. Performance summary
» Manage Memory with WeakReference
Caching
› Avoid memory problems by always accessing image
data in memory using a WeakReference Cache.
› Create a type of virtual memory by duplicating the
WeakReference cache contents in Flash memory
(Record Management System) so that you can quickly
recover items which are no longer available in RAM.
35. Performance summary
» Use micro-optimizations of the code as habit
› Know the rules of micro-optimisation for memory
performance, logic and calculations. Include those as
you develop, but trust Proguard to add the finishing
touches.
› Help Proguard by making everything possible final or
static final. Avoid static variables in high performance
loops as they are slower than instance variables.
36. Performance summary
» Profile your app towards the end of project
› Profile your application in an emulator.
› Also test the actual run-time of critical code sections on
the phone using System.currentTimeMillis() to see and
carefully measure the effects of your code changes.
37. › Extreme Mobile Java
JavaOne 2012 Performance Tuning, User
San Francisco Experience, and Architecture
Patterns
› Wednesday, Oct 3, 11:30AM
› Notel Nikko – Monterey I/II
› http://tinyurl.com/95moz2l
› Java for Mobile Devices: New
Horizons with Fantastic New
Devices
› Monday, Oct 1, 8:30AM
› Notel Nikko – Monterey I/II
› http://tinyurl.com/8lndb3m