Web Performance tuning presentation given at http://www.chippewavalleycodecamp.com/
Covers basic http flow, measuring performance, common changes to improve performance now, and several tools and techniques you can use now.
This document discusses how to avoid getting lost in the current JavaScript landscape. It begins by looking at modern web development trends like HTML5, CSS3, ES6, and expectations of fast page loads. It then examines traditional page lifecycles versus single page applications and various JavaScript frameworks. The document advocates for progressive enhancement and outlines strategies like "Hijax" and using the HTML5 History API to improve traditional approaches. It also discusses issues like code duplication, the benefits of isomorphic JavaScript, and tools for frontend development including Grunt, Gulp, asset bundlers, and test runners. It concludes by providing recommendations on technologies to adopt, consider, or stop using to develop with a progressive enhancement approach.
The document provides an overview of the modern JavaScript ecosystem. It discusses the main execution environments (browsers, Node.js, io.js), web servers (Express, Hapi, Koa), package managers (NPM, Bower), task runners (Grunt, Gulp, Broccoli), front-end frameworks (jQuery, Backbone, Angular, Ember, React), module systems (AMD, CommonJS, ES6 modules), and JavaScript flavors/transpilers (CoffeeScript, TypeScript, Dart, ES6). It also outlines the typical development workflow from writing code to compilation/packaging to deployment on a web server to usage in a browser.
Seven Jobs You Should Be Running #sqlsat126Mike Hillwig
This document discusses 7 SQL Agent jobs that should be running to monitor a SQL Server environment. It provides background on the presenter, Mike Hillwig, and introduces the topic of using SQL Agent to automate monitoring processes. Example monitoring jobs discussed include checking for auto shrink being enabled, verifying backups are running successfully, and alerting on failed SQL Agent jobs. The presentation aims to provide both introductory information on SQL Agent and specific monitoring jobs and scripts that can be implemented.
This document provides an agenda for a class on databases and asynchronous JavaScript. It includes presentations of Project 2, a review of asynchronous concepts like callbacks, promises, and async/await. It also covers differences between SQL and NoSQL databases, examples of using SQL and MongoDB, and an introduction to using a Postgres database on Bluemix. Homework involves SQL queries on a Stack Overflow database and students are notified to begin working on Project 3, which will involve a database backend and chatbot.
This document provides an overview of various topics related to developing a NodeJS application with a database. It discusses mindsets for developers, resources for learning to code like online courses and communities, and technologies involved in web development like front-end versus back-end programming. It also introduces NodeJS, databases like MongoDB and Cloudant, and provides instructions for an example app using Cloudant on Bluemix. Students are assigned homework to deploy this example app and modify it for their own purposes.
This document summarizes Chris Skardon's experience migrating the database for his competition running site Tournr from SQL to document and graph databases. It describes how the initial database choice of SQL Server became limiting and led to migrations first to RavenDB, a document database, and then to Neo4j, a graph database. Both migrations required reworking the data model and code but provided performance and flexibility benefits. While challenging, the migrations were worthwhile as the graph model better fit Tournr's needs.
Our presentation on Israel Rails Conference 2012. Vitaly talking about rails performance, how to measure, what to improve and just as much important - what not to improve
This document provides an agenda and overview for an introductory course on web development. The course will cover the hardware and protocols that power the internet, including how typing a URL leads to loading a webpage. It will introduce concepts like IP addresses, DNS, routers, servers, and HTTP. The instructor's background and course structure are outlined, which involves weekly lectures, exercises, and group projects building websites and backend services. Previews of upcoming modules show topics will include JavaScript, databases, APIs, and pitching projects.
This document provides an agenda and overview for a class on front end frameworks, JavaScript, and project 2. It discusses introducing Bootstrap and UI-Kit, JavaScript exercises including functions, variables, control flow, and built-in functions. It outlines homework 4 requirements and reviews frameworks, templates, and JavaScript examples. It describes project 2 expectations and grading criteria, then assigns homework 5 to start building a multi-week pizza ordering website project.
The document outlines the agenda for the final week of a web development course. It includes wrap-up discussions, group presentations, course surveys, and demos of web applications built with technologies like React, Node.js, and Google Cloud Platform. Students will also discuss current trends in web development tools and technologies and strategies for continuing their learning after completing the course.
This document provides an agenda and instructions for setting up a server and database for a coding project. It discusses setting up a Node.js server on Digital Ocean, forking a sample project on GitHub, installing dependencies with NPM, running the server, and using EJS templates and MySQL Workbench to connect to and modify a database. Students are instructed to fork the sample project, modify it to use their own database, run it on their server, and submit the GitHub link and website URL for homework.
This class covers reviewing Git and server commands, Bootstrap tables, and introduces some new JavaScript topics like variables, user input/output, and variable scope. The homework assignment asks students to update their pizza ordering application to allow items to be typed in and generate a receipt with columns for item details and calculated totals. Key topics reviewed include Git commands like log, blame, checkout, Bootstrap tables and responsive design, JavaScript variables, parsing user input, and variable scope.
Best Practices in SharePoint Development - Just Freakin Work! Overcoming Hurd...Geoff Varosky
Abstract: “Why am I getting a security error??” “Why does my code work sometimes, but not others?” “I wonder if McDonalds is hiring.” Writing custom code in SharePoint opens up unlimited possibilities but also throws many hurdles in your way that will slow you down if you don’t take them into account. So, before giving up and searching for careers in the fast food industry, equip yourself with the knowledge you need to succeed in writing custom code for SharePoint.
Flexible UI Components for a Multi-Framework WorldKevin Ball
Slides from Flexible UI Components talk given at Web Unleashed 2017
Build UI components that work seamlessly in every JavaScript Framework.
Your core UI elements shouldn’t have to be different for your marketing site than they are in your application just because the former uses jQuery while the latter is built using Angular or React.
Lessons learned from work on ZURB Foundation 7.
This document discusses asynchronous JavaScript, databases, and Project 3. It introduces callbacks, promises, and async/await in JavaScript. It also covers the differences between SQL and NoSQL databases, provides examples of using SQL databases locally and online, and exercises on SQLZOO. It describes Project 3 as connecting a database to the back end of an application. Students are instructed to draw out their database structure, write queries, and demo their working Project 3 application connecting to an actual database by the due date.
This document provides an agenda and summary for the last class of a course on web development. It discusses homework on using JSON and databases, presentations from student group projects, and next steps. It reviews key topics covered in the course like HTML, CSS, JavaScript, databases, and hosting platforms. The document previews the main topics planned for upcoming modules, provides examples of interesting websites using technologies like speech recognition, and ends with an open question period.
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.
This document introduces Jest, a JavaScript testing framework. It discusses why Jest is useful, including that it runs tests in parallel sandboxed environments, provides a fast feedback loop with rich logging and error outputs, and acts as a one-stop shop for testing. The document also covers anatomy of Jest tests, how to use mocking, tips like resetting modules between tests and snapshot testing, and references for additional Jest resources.
This document provides an agenda and overview for a developer training session. It discusses developing a growth mindset for programming, strategies for managing frustration, resources for learning programming concepts and getting help, and approaches for collaborative work. It also introduces backend concepts like servers, databases, and JavaScript on the server side using Node.js. The homework assignment involves researching and documenting programming resources.
10 Things You Can Do to Speed Up Your Web App TodayChris Love
Web Performance is a serious issues these days. 80% of web performance issues are in the client. Many developers either do not realize what they are leaving on the table and how that affects the success of their application. These are 10 things any web developer can do in about 30-60 minutes to drastically increase page load times and thus increase the application's profitability.
Ruby on Rails Performance Tuning. Make it faster, make it better (WindyCityRa...John McCaffrey
(reposting with clearer title)
Performance tuning presentation from WindyCityRails 2010.
Why performance matters
The right way to approach it
Front end testing tools
Automated testing tools
Common problems and the ways to solve them in Rails
Rails specific tools
bullet
slim_scrooge
rack bug
request log analyzer
rails indexes
10 things you can do to speed up your web app today stir trek editionChris Love
Why is Web Performance Optimization Important and what are some things developers can do to ensure their applications perform well and please end users?
This document discusses web performance optimization and provides tips to improve performance. It emphasizes that performance is important for user experience, search engine optimization, conversion rates, and costs. It outlines common causes of performance issues like round-trip times, payload sizes, browser rendering delays, and inefficient JavaScript. Specific recommendations are given to optimize images, stylesheets, scripts, and browser rendering through techniques like compression, caching, deferred loading, and efficient coding practices. A variety of tools for measuring and improving performance are also listed.
Single Page Applications: Your Browser is the OS!Jeremy Likness
Single Page Applications have gained tremendous popularity over the past few years and have prompted the creation of several frameworks to support their development. Unlike traditional web applications, most of the heavy lifting for SPA happens on the client side in your web browser. These applications rely on hundreds of lines of JavaScript coupled with asynchronous web service calls to provide a desktop-like experience that is accessible from virtually any device.
Join Principal Architect, Jeremy Likness, to learn more about SPA, including how to determine when you should choose this approach, how SPA compares and contrasts with traditional server-based approaches including ASP.NET WebForms and MVC, and what frameworks and tools (such as jQuery, AngularJS, and Aurelia) make building SPA easier. Discover how single page applications powered by HTML5 and JavaScript transform your browser into a web-based operating system.
This document provides practical strategies for improving front-end performance of websites. It discusses specific techniques like making fewer HTTP requests by combining files, leveraging browser caching with far-future expires headers, gzipping components, using CSS sprites, and deploying assets on a content delivery network. It also summarizes key rules from tools like YSlow and PageSpeed for optimizing front-end performance.
Does This Theme Make My Website Look Fat? (Wordcamp SLC 2013)Adam Dunford
While the principles of responsive web design can make sites look better on mobile devices, they don’t necessarily load faster than a site designed for desktops. And as more and more sophisticated WordPress themes emerge, with their multiple options and fancy sliders, websites just keep getting more and more bloated.
This presentation will help cut out the junk that’s larding up your sites so you can better meet the demand of users wanting fast-loading user experiences–no matter the device or connection.
Presented at WordCamp Salt Lake City 2013 (http://2013.slc.wordcamp.org/)
Why your slow loading website is costing you sales and how to fix itstrommen
This document discusses how slow loading websites can negatively impact business by reducing conversions and increasing abandonment. It covers:
1. Research showing websites that load faster increase donations, click-through rates, and conversions while decreasing abandonment.
2. How browsers load pages over TCP and HTTP, including how objects like JavaScript, CSS, images are retrieved.
3. Methods for measuring page speed like load time, start render time, and speed index.
4. Techniques for speeding up websites like GZip compression, caching, optimizing images, bundling resources, and minimizing web fonts.
Why your slow loading website is costing you sales and how to fix itRobert Flournoy
Learn: Why your website MUST be fast to be competitive, how a page is loaded by the browser, how to measure page speed and 5 simple ways to speed up YOUR website
.
The document discusses improving mobile web performance. It notes that mobile is different than desktop due to limitations in power, memory, battery and connections on mobile devices. Sites are growing larger in size which slows performance, and users strongly prefer faster loading sites. A variety of tools can measure performance, and waterfalls charts show where time is spent loading pages between the server and client. Optimizations discussed include enabling caching, compression, image resizing, lazy loading images, inlining images and scripts where possible, minifying assets, and delivering scripts and styles in a single HTTP request through techniques like application caching.
This is my latest version of my client side performance presentations. This has been presented at TechEd NZ 2009 & to a couple of .NET user groups around NZ. This presentation focuses on the basics of client-side performance tuning.
5 Common Mistakes You are Making on your WebsiteAcquia
The document discusses common mistakes that are often found during website audits. It covers 5 categories: content architecture, display architecture, site architecture, security, and performance. Some examples of mistakes mentioned include having similar content types, not reusing fields, extra modules installed that are not useful, reinventing functionality that Drupal already provides well, outdated core/contrib modules, and complex queries without indexes. The document provides best practices for each category such as planning content architecture ahead of time, separating logic from presentation, using the right hooks for custom modules, keeping software updated, and optimizing databases before caching. It emphasizes the importance of testing, environments, and maintenance for the website lifecycle.
[Srijan Wednesday Webinars] Developing Large Scale Applications in AngularJSSrijan Technologies
AngularJS is currently at the forefront of MVC (Model View Controller) frameworks for the web, and it makes it very simple to develop prototypes and web applications in it. But how do we ensure that the large scale applications we develop remain high performance, bug free and fast?
In this webinar, our speaker shared his learnings from developing various large scale AngularJS applications. He also shared how to create a maintainable project structure, and cover common performance bottlenecks and best practices to follow.
Watch complete webinar recording: http://youtu.be/b92Y77TExiA
Web Components at Scale, HTML5DevConf 2014-10-21Chris Danford
At Pinterest, we've begun experimenting in production with Web Components. This talk will discuss some challenges of implementing Web Components in a large scale production environment such as SEO concerns, reasonable fallbacks for browsers not supported by Platform.js, migrating a large code base component-by-component to mitigate risk, and optimizing page load and scroll performance.
The document discusses website performance and optimization. It notes that nearly half of users expect a site to load within 2 seconds and will abandon a site taking longer than 3 seconds. Common issues causing poor performance are bloated templates, unnecessary code, and too many HTTP requests. Suggested optimizations include minimizing assets, prioritizing visible content, image optimization, caching, compression, and lazy loading. Case studies show significant speed improvements after implementing optimizations. Metrics like Speed Index measure how quickly visible content displays to influence perceived performance.
Lets look at an example of what a performant website can look like. This discuss what concepts should we be considering when looking at website performance. Next we will go over two areas pertaining to website performance: 1) website performance tweaks that you as a web developer can directly make 2) website performance tweaks that you may have to work with your hosting provider or IT department to achieve
This document discusses technologies for creating and maintaining web applications. It covers Ruby and the Rails framework. Ruby is designed to be programmer-focused rather than machine-focused, helping create dynamic and self-explained code. Rails enables quickly building web servers through conventions, reuse, single responsibility principles, and features that provide quick setup, deployment, and built-in scalability. The document also discusses front-end architecture with client-side logic, and Rails features for development, deployment, databases, assets, and multi-environment configuration.
The document discusses improving web performance and optimization. It provides an overview of key performance metrics such as time to first byte, time to first impression, onLoad time and fully loaded time. It also discusses tools for measuring performance like Yahoo! YSlow and Google PageSpeed which provide guidelines and scores on items that impact performance. Overall page speed, number of requests, YSlow and PageSpeed scores are important metrics to consider.
Isomorphic React Applications: Performance And ScalabilityDenis Izmaylov
Isomorphic React applications allow code to run on both the client and server, improving performance and scalability. Server-side rendering builds HTML on the server so the page loads immediately before JavaScript loads. This improves the user experience but requires loading data asynchronously. Caching pre-rendered components and separating rendering can improve performance. Progressive rendering and Facebook's BigPipe technique can further optimize loading. Performance can also be improved through code optimizations like using direct React files and load balancing with multiple server instances.
Building performance into the new yahoo homepage presentationmasudakram
Nicholas Zakas presented on optimizing the performance of the Yahoo homepage redesign from 2010. The new design added significant functionality but also increased page size and complexity, threatening performance. Areas of focus included reducing time to interactivity, improving Ajax responsiveness, and managing perceived performance. Through techniques like progressive rendering, non-blocking JavaScript loading, and indicating loading states, performance was improved and maintained users' perception of speed. The redesign achieved onload times of ~2.5 seconds, down from ~5 previously, while perceived performance matched the previous version.
The document contains data in bar and pie charts, with the bar chart showing orange at 100, blue at 76, and green at 35, and the pie chart showing data points of 30, 70, and 11. It also mentions a nice beach.
A Taste of TDD: The basics of TDD, why it is hard and how to do it betterJohn McCaffrey
A Taste of TDD: Basic overview of Agile Testing, TDD in practice, Pros/Cons of Test Driven Development, Recent TDD Controversey (DHH, Kent Beck, Martin Fowler), and some strategies for doing it well.
This is a lead in to a full Agile Workshop on Scrum/XP, TDD, and Pairing
Becoming a more Productive Rails DeveloperJohn McCaffrey
Tips and tricks for how to accelerate your technical learning, take better notes, search in the right places, get help faster, solidify your understanding and hold on to what you've learned.
LeanStartup:Research is cheaper than developmentJohn McCaffrey
The document discusses the importance of conducting thorough research before beginning development on a new project. It argues that research is cheaper than development and can help define the problem, understand existing terminology and solutions, identify target customers, and find market trends. Both primary and secondary research methods are covered, including interviews, online searches, social bookmarking, and polling forums. The presentation provides tips for creating a project profile and researching problems, customers, influencers, and monitoring competitors. It emphasizes gathering useful data and testing hypotheses before taking action.
Becoming a more productive Rails DeveloperJohn McCaffrey
A presentation by John McCaffrey of RailsPerformance.com on how to manage technical information, ask technical questions, expand Ruby and Rails knowledge, and work on interesting side projects for open source, non-profits or as a freelancer
PDF Generation in Rails with Prawn and Prawn-to: John McCaffreyJohn McCaffrey
breakdown of the most commonly used pdf libraries in rails projects,and an in depth review of prawn
example pdfs and code can be seen at prawn.heroku.com
More info at www.RailsPerformance.com
Self-Healing Test Automation Framework - HealeniumKnoldus Inc.
Revolutionize your test automation with Healenium's self-healing framework. Automate test maintenance, reduce flakes, and increase efficiency. Learn how to build a robust test automation foundation. Discover the power of self-healing tests. Transform your testing experience.
"Building Future-Ready Apps with .NET 8 and Azure Serverless Ecosystem", Stan...Fwdays
.NET 8 brought a lot of improvements for developers and maturity to the Azure serverless container ecosystem. So, this talk will cover these changes and explain how you can apply them to your projects. Another reason for this talk is the re-invention of Serverless from a DevOps perspective as a Platform Engineering trend with Backstage and the recent Radius project from Microsoft. So now is the perfect time to look at developer productivity tooling and serverless apps from Microsoft's perspective.
DefCamp_2016_Chemerkin_Yury-publish.pdf - Presentation by Yury Chemerkin at DefCamp 2016 discussing mobile app vulnerabilities, data protection issues, and analysis of security levels across different types of mobile applications.
Keynote : AI & Future Of Offensive SecurityPriyanka Aash
In the presentation, the focus is on the transformative impact of artificial intelligence (AI) in cybersecurity, particularly in the context of malware generation and adversarial attacks. AI promises to revolutionize the field by enabling scalable solutions to historically challenging problems such as continuous threat simulation, autonomous attack path generation, and the creation of sophisticated attack payloads. The discussions underscore how AI-powered tools like AI-based penetration testing can outpace traditional methods, enhancing security posture by efficiently identifying and mitigating vulnerabilities across complex attack surfaces. The use of AI in red teaming further amplifies these capabilities, allowing organizations to validate security controls effectively against diverse adversarial scenarios. These advancements not only streamline testing processes but also bolster defense strategies, ensuring readiness against evolving cyber threats.
Latest Tech Trends Series 2024 By EY IndiaEYIndia1
Stay ahead of the curve with our comprehensive Tech Trends Series! Explore the latest technology trends shaping the world today, from the 2024 Tech Trends report and top emerging technologies to their impact on business technology trends. This series delves into the most significant technological advancements, giving you insights into both established and emerging tech trends that will revolutionize various industries.
Garbage In, Garbage Out: Why poor data curation is killing your AI models (an...Zilliz
Enterprises have traditionally prioritized data quantity, assuming more is better for AI performance. However, a new reality is setting in: high-quality data, not just volume, is the key. This shift exposes a critical gap – many organizations struggle to understand their existing data and lack effective curation strategies and tools. This talk dives into these data challenges and explores the methods of automating data curation.
Connector Corner: Leveraging Snowflake Integration for Smarter Decision MakingDianaGray10
The power of Snowflake analytics enables CRM systems to improve operational efficiency, while gaining deeper insights into closed/won opportunities.
In this webinar, learn how infusing Snowflake into your CRM can quickly provide analysis for sales wins by region, product, customer segmentation, customer lifecycle—and more!
Using prebuilt connectors, we’ll show how workflows using Snowflake, Salesforce, and Zendesk tickets can significantly impact future sales.
"Making .NET Application Even Faster", Sergey Teplyakov.pptxFwdays
In this talk we're going to explore performance improvement lifecycle, starting with setting the performance goals, using profilers to figure out the bottle necks, making a fix and validating that the fix works by benchmarking it. The talk will be useful for novice and seasoned .NET developers and architects interested in making their application fast and understanding how things work under the hood.
Welcome to Cyberbiosecurity. Because regular cybersecurity wasn't complicated...Snarky Security
How wonderful it is that in our modern age, every bit of our biological data can be digitized, stored, and potentially pilfered by cyber thieves! Isn't it just splendid to think that while scientists are busy pushing the boundaries of biotechnology, hackers could be plotting the next big bio-data heist? This delightful scenario is brought to you by the ever-expanding digital landscape of biology and biotechnology, where the integration of computer science, engineering, and data science transforms our understanding and manipulation of biological systems.
While the fusion of technology and biology offers immense benefits, it also necessitates a careful consideration of the ethical, security, and associated social implications. But let's be honest, in the grand scheme of things, what's a little risk compared to potential scientific achievements? After all, progress in biotechnology waits for no one, and we're just along for the ride in this thrilling, slightly terrifying, adventure.
So, as we continue to navigate this complex landscape, let's not forget the importance of robust data protection measures and collaborative international efforts to safeguard sensitive biological information. After all, what could possibly go wrong?
-------------------------
This document provides a comprehensive analysis of the security implications biological data use. The analysis explores various aspects of biological data security, including the vulnerabilities associated with data access, the potential for misuse by state and non-state actors, and the implications for national and transnational security. Key aspects considered include the impact of technological advancements on data security, the role of international policies in data governance, and the strategies for mitigating risks associated with unauthorized data access.
This view offers valuable insights for security professionals, policymakers, and industry leaders across various sectors, highlighting the importance of robust data protection measures and collaborative international efforts to safeguard sensitive biological information. The analysis serves as a crucial resource for understanding the complex dynamics at the intersection of biotechnology and security, providing actionable recommendations to enhance biosecurity in an digital and interconnected world.
The evolving landscape of biology and biotechnology, significantly influenced by advancements in computer science, engineering, and data science, is reshaping our understanding and manipulation of biological systems. The integration of these disciplines has led to the development of fields such as computational biology and synthetic biology, which utilize computational power and engineering principles to solve complex biological problems and innovate new biotechnological applications. This interdisciplinary approach has not only accelerated research and development but also introduced new capabilities such as gene editing and biomanufact
Demystifying Neural Networks And Building Cybersecurity ApplicationsPriyanka Aash
In today's rapidly evolving technological landscape, Artificial Neural Networks (ANNs) have emerged as a cornerstone of artificial intelligence, revolutionizing various fields including cybersecurity. Inspired by the intricacies of the human brain, ANNs have a rich history and a complex structure that enables them to learn and make decisions. This blog aims to unravel the mysteries of neural networks, explore their mathematical foundations, and demonstrate their practical applications, particularly in building robust malware detection systems using Convolutional Neural Networks (CNNs).
Choosing the Best Outlook OST to PST Converter: Key Features and Considerationswebbyacad software
When looking for a good software utility to convert Outlook OST files to PST format, it is important to find one that is easy to use and has useful features. WebbyAcad OST to PST Converter Tool is a great choice because it is simple to use for anyone, whether you are tech-savvy or not. It can smoothly change your files to PST while keeping all your data safe and secure. Plus, it can handle large amounts of data and convert multiple files at once, which can save you a lot of time. It even comes with 24*7 technical support assistance and a free trial, so you can try it out before making a decision. Whether you need to recover, move, or back up your data, Webbyacad OST to PST Converter is a reliable option that gives you all the support you need to manage your Outlook data effectively.
2. John McCaffrey: Its all about me
• Doing Java since 2000, Rails since 2007
• Presented at WindyCityRails
– 2008: Advanced Firebug and JS unit testing
– 2009: PDF Generation in Rails
– 2010: Rails Performance Tuning
• Addicted to Performance Tuning
• railsperformance.blogspot.com
• Feedback: http://spkr8.com/t/4961
@J_McCaffrey
railsperformance@gmail.com
(the slides will be available, with additional references)
3. What are we gonna cover?
• Performance touches a lot of layers
• We have a very diverse audience
6. def organization_branches
get_organizations.flatten.uniq.select{|org| org.children.size > 0}
end
def organization_leaves
get_organizations.flatten.uniq.select{|org| org.children.size == 0}
end
def load_organizations
branches = current_user.organization_branches
leaves = current_user.organization_leaves
@branches = branches.to_json(:only => [:id, :name])
@leaves = leaves.to_json(:only => [:id, :name])
@organizations = @criteria.branch ?
leaves.collect {|o| [ o.name.titleize, o.id ] }.sort :
branches.collect {|o| [ o.name.titleize, o.id ] }.sort
end
It all started...
2811 queries!
Down to 17!!
7. And then...
Invoicing issue:
If a customer resubmits an order with 2 years,
they should be charged $9 but were only being
charged $4.50
How common are ROI calculations on software projects?
53626 * $4.50 = $241,317 (just in the last year)
8. Our theme of the day: Leverage
to achieve the greatest value
10. Performance and Business metrics: Speed matters
Amazon: 100 ms delay caused a 1% drop in revenue.
Google: 400 ms delay caused a 0.59% decrease in search requests per user.
Yahoo!: 400 ms delay caused a 5-9% decrease in traffic.
Bing: 2 sec delay caused a 4.3% drop in revenue per user.
Mozilla made their download page 2.2 seconds faster and saw an
increase of 15.4% in downloads.
Google Maps reduced the file volume by 30% and observed a
30% increase in map requests.
Netflix enabled gzip on the server; pages became 13-25% faster and
saved 50% of traffic volume!
11. Performance and Business metrics: Shopzilla.com
Went from 6 sec
down to 1.2sec
http://www.phpied.com/the-performance-business-pitch/
12. Fred Wilson: Speed is the most important feature
10 Golden Principles of Successful Web Apps
Fred Wilson, Venture Capitalist www.avc.com
•Speed• Instant Utility
• Software is media
• Less is More
• Make it programmable
• Make it personal
• Make it RESTful
• Discoverability
• Clean
• Playful
14. Give yourself a fighting chance, make a plan
Alois Reitbauer, dynatrace
Anti-patterns
• Thinking Scalability something you just sprinkle on later
• Guessing, not testing
• Ad-hoc, unstructured
• Waiting until it hurts, not proactively planning
• Thinking that any early planning is Premature optimization
Video on Parleys.com
18. Premature optimization
"Premature optimization is
the root of all evil'
-Donald Knuth
"Quoting Knuth, as a way to
avoid planning for performance
issues, is a cop-out"
@J_McCaffrey
Don't waste time on making
optimization changes until you
KNOW they are necessary
19. If you can not measure it,
you can not improve it.
— Lord Kelvin
20. Let's do this the right way
Measure:
• Understand the tools to use, at each layer, to measure
and monitor performance
Create repeatable tests:
• Be able to invoke the system and easily test
• A/B, before/after tests, long-term monitoring
Isolate your changes:
• One thing at a time
That's it: Measure, Test, and Isolate your changes
21. Terminology
Load:
How much work is
there?
Utilization:
How much of the
resources are in use?
Scalability:
How well can we
handle the load?
Throughput:
How many tasks can
be done per unit of
time?
Concurrency:
How many tasks can
we do at once?
Capacity:
How big can our
throughput go before
things fall apart?
Response time (avg) == Latency
Requests per second == Throughput
22. Terminology
Performance:
• The resources and Time for a single request
• Measured in Response Time
Throughput:
• The number requests that can be handled per/time
• Measured in Requests per second
Scalability:
• Ability to grow and handle more requests, without
significantly degrading the experience
Performance != Scalability
23. Terminology
Let's say:
1 worker that can compute a job in .5 sec
Throughput = 2 jobs per sec
Latency = .5 sec per job
Performance != Scalability
Adding more workers will not improve the latency
But not having enough workers can increase the
response time, due to Queuing and delay
25. Waterfall: Twitter.com
Waterfall
Total time: 3815 ms
Dynamic generation: 250 ms
(~7%)
Static: 3369 ms (~89%)
* Will not add to 100%
When the html is downloaded
When the rest
of it is loaded
28. Firebug Netpanel
Simple and repeatable way to measure page load
Usually, less than 20% of the time is spent in fetching the HTML
So how do we optimize the other 80%?
29. YSlow
• Created by Steve Souders
• Observes the netpanel data, applies rules and gives you a
score.
• Deep understanding of how the browser works
• Its the best way to have a repeatable, measurement of your
site's load performance
http://developer.yahoo.com/yslow
30. YSlow
• Minimize HTTP Requests
• Use a Content Delivery Network
• Add an Expires or a Cache-Control Header
• Gzip Components
• Put StyleSheets at the Top
• Put Scripts at the Bottom
• Avoid CSS Expressions
• Make JavaScript and CSS External
• Reduce DNS Lookups
• Minify JavaScript and CSS
• Avoid Redirects
• Remove Duplicate Scripts
• Configure ETags
• Make AJAX Cacheable
• Use GET for AJAX Requests
• Reduce the Number of DOM Elements
• No 404s
• Reduce Cookie Size
• Use Cookie-Free Domains for Components
• Avoid Filters
• Do Not Scale Images in HTML
• Make favicon.ico Small and Cacheable
32. Google Page speed
• Similar to YSlow
• includes paint events
• separates out ads, trackers from your content
• better recommendations and optimizations
• 1 click to see optimized version of your files
http://code.google.com/speed/page-speed
36. Summary
• Page load is the place to start
• Read everything in the Yslow and PageSpeed rules
• Encourage other devs to play with YSlow, PageSpeed
• Show Webpagetest.org, and zoompf.com to the boss
Now that we have a way to measure page
performance, we can think about making changes
38. Isn't everyone already doing this?
Analysis of the Alexa top 1000 sites found:
• 42% don't gzip
• 44% have more than 2 css files
• 56% serve css from a cookied domain
• 62% don't minify
• 31% have more than 100k size css
Top 1000 retail sites
50% aren't doing both keep-alive and compression
(the 2 easiest things!!)
39. Compress with Gzip
• Can save you 50% to 80% of your bandwidth
• Simplest performance improvement you can make
• Beware differences in browsers
• File types: html, js, css, xml, rss, txt, font, json
Probably the simplest and smartest
thing you can do for your app!
40. Combine and minify javascript and css
Rails
• javascript_include_tag :all, :cache => "all"
• Asset_packager, Jammit
Load common js libraries from google
http://github.com/rpheath/google_ajax_libraries_api
Jsmin or YUICompressor
Closure compiler
Let's check it out!
41. Combine and minify javascript and css
Sprites and image optimization
• spriteme.org
• JqueryUI already gives you sprited images
Image optimization
• Smush.it
42. Expires and Browser Caching
Setting a far future expires tells the browser not to ask for the file
Expires:Mon, 02 Sep 2030 21:23:08 GMT
/images/logo.png?1234567890
Using the query string lets us break the caching by having the
browser ask for a new file
There is a problem with using a URL query string this way
http://blog.eliotsykes.com/2010/05/06/why-rails-asset-caching-is-broken/
/images/logo-fp-839b180ff39a24f8d6e0ee70e4c40fed.png
43. Rails Caching
Take your dynamic content, and make it static
• Page
• Action
• Fragment
Full length tutorials
• http://railslab.newrelic.com/
• http://railscasts.com/episodes?search=caching
• Greg Pollack Aloha on Rails http://vimeo.com/10860860
49. Commercial tools
New Relic
• Developer plugin is a good start
• Free version doesn’t get you much (Bronze version with heroku)
• Works for .NET
• Scoutapp.com
• Similar to new Relic
• Large selection of community plugins
50. Testing tools
Apache bench
ab -n 10 -c 2 http://www.somewhere.com/
Httperf
httperf --server localhost --port 3000 --uri / --num-conns 10000
Jmeter
yes, its ugly, but its powerful
52. Database issues
Common database issues
• Bad queries
• Not utilizing explain
• Inadequate indexes
• N+1 queries
• Selecting more data than is needed
• Inconsistent queries for the same data
53. Query_reviewer
Common database issues
• Bad queries
• Not utilizing explain and slow query log
• http://github.com/dsboulder/query_reviewer
• Runs explain on all of your queries, outputs to div in
page
55. Bullet plugin
Bullet plugin
• http://github.com/flyerhzm/bullet
Help you reduce the number of queries
with alerts (and growl).
56. Slim_scrooge
Be more specific in your select
• http://github.com/sdsykes/slim_scrooge
• Instruments your code
• Observes the usage pattern
• Suggests/changes your select statement
• When invoked within the exact same context
57. Ruby Issues
Most are due to memory problems
• Slow GC
• Not release references
• Capturing scope
• Profiling will reveal what’s going on
• http://guides.rubyonrails.org/performance_testing.html
If you want to learn everything there is to know about profiling
• Aman Gupta & Joe Damato
• http://timetobleed.com/
• http://memprof.com/
• They’ve already identified and fixed several memory leaks
58. Ruby issues: Faster Ruby Libraries
C Extension++
• XML parser http://nokogiri.org/
• JSON parser http://github.com/brianmario/yajl-ruby/
• CSV parser http://www.toastyapps.com/excelsior/
• HTTP client http://github.com/pauldix/typhoeus
Date
http://github.com/jeremyevans/home_run
59. Take home points
Performance
• Performance affects the bottom line
• The biggest performance win is usually in improving the load time
• Continue to monitor and test your apps performance over time
• Gzip, combine and minify to get a big boost
• Lack of indexes is likely to be one of your biggest backend issues
• Try to stay up to date with Libraries and patches
• A well tested codebase is easier to tune!
• Upgrading to ruby 1.9 will give you a huge performance boost
60. Links: great info on performance
Performance
• Scaling Rails series http://railslab.newrelic.com
• RailsCasts.com
• Velocity Conf http://en.oreilly.com/velocity2010
• Google io conf http://code.google.com/events/io/2010/
• dynatrace site http://ajax.dynatrace.com/pages/
• http://www.igvita.com
• http://www.mysqlperformanceblog.com
61. Wait, I made it through that?
Designing for performance
• Watch how they really use it
• Multiple tabs?
• Back and forth between list and detail view
• Great presentation at WindyCityRails2009 by David Eisinger
• Optimizing perceived performance
• Make it feel fast
62. Wait, I made it through that?
Architectural musings
•Background long running tasks
• Email, image processing, reports, feeds
•Leverage Rack, Sinatra or Padrino
•Parallel processing, Event Machine
•Learn from heroku, scalable from the start
•Revaluate your cloudy-ness
• Great RailsConf presentation by James Golick
64. Beyond ySlow:
improving page
performance
outside the
initial load
MySql and
Postgres
Database tuning
Heroku: Building
Scalable apps
from the start
Tuning
performance
for Mobile
devices
Performance
Improvements
coming in Rails
3, and 3.1
Speeding up
your tests
65. Questions for you
Architectural musings
• Moving to or already on Ruby 1.9?
• Serving your content from a separate domain
• Cookieless?
Editor's Notes
I really enjoy helping people get the most out of their apps
add some color to these slides!
There is so much to cover, and I want to make sure that everyone gets something valuable out of this talk, whether you are just starting out, or you work for Groupon, serving mils of hits a day.
My main objective is to help you get started. To know where to look, which tools to use, which techniques to investigate, and where to find the resources you need.
I won't be able to teach you everything about performance, but I can at least get you excited, and point you in the right direction.
If i don't teach you something new, or you don't get what you were looking for, please come up and talk to me. We can chat afterwards, if you have a specific issue, I'm sure I can help you out.
how I got started
customer complained report page was slow in prod
first 2 methods are from the model, the 3rd is from the controller
This code basically sets up 2 drop downs to pick which organization you want to run a report for.
I knew it was slow, and I knew it was wrong, but I didn't know all the ways that it was wrong
got my first taste of poorly performing Rails code
I learned:
test with real data
review your queries
let the database do what it do
watch out for N+1 queries
avoid unnecessary columns
add indexes
optimize the page
lack of testing, leads to an odd pattern of reuse without refactoring or improving
It was a rewarding experience knowing that a few basic changes were now going to improve the performance in several places in the app, and make a lot of people very happy.
The next day they asked me if I could look into a discrepancy they had in the billing code.
This only occurs if they have to resubmit due to their own delay, and then only if they have more than one year ordered.
I fixed the issue, but then became ridiculously curious about how much this bug had cost.
Its not just having 2yrs, its having more than one, and there are several orders with 3 or 4yrs.
It was one of the first times I knew how much a bug cost, and could measure the return on the time it took to fix it.
i then became obsessed with knowing how much a unit of development was going to be worth.
It was a powerful feeling, to have real numbers.
This is info that the rest of the business world is used to having, and how McDonald's knows that it can sell 59cent cheesburgers.
What's the ROI?
When will we break even?
These 2 experiences, where I was able to observe massive improvements with a small but focused effort, encouraged me to seek out more opportunities to maximize return
Leverage is an important theme here. When it comes to making the right performance decisions, we want to use the greatest leverage, and get big gains for small effort.
Gzip is a great example of leverage
Open source software
Jake’s talk on metric_fu is a great example of leverage
Nick’s talk on improving test performance is extremely valuable
Improving performance is all about leverage, and its all about money
The major sites know this, and you can see it in the work they do.
Google just released instant search, because they know that faster search means more money
google includes it in their adwords calculation
velocity conference 2009
google did a similar experiment, adding a delay of only 400ms, and saw a .6% drop in searches, but most interestingly, even after they were done with the experiment,and removed the delay, those users still did significantly less searches,, showing that bad performance leaves a lasting impression
Yahoo also added 400ms delay, and saw a 5-9% drop in full page traffic, meaning that as soon as the users started to feel a slow experience, they killed the page and went somewhere else (something to think about if you are the #3 player)
http://www.phpied.com/the-performance-business-pitch/
Improving performance is all about leverage, and its all about money
The major sites know this, and you can see it in the work they do.
Google just released instant search, because they know that faster search means more money
google includes it in their adwords calculation
velocity conference 2009
google did a similar experiment, adding a delay of only 400ms, and saw a .6% drop in searches, but most interestingly, even after they were done with the experiment,and removed the delay, those users still did significantly less searches,, showing that bad performance leaves a lasting impression
Yahoo also added 400ms delay, and saw a 5-9% drop in full page traffic, meaning that as soon as the users started to feel a slow experience, they killed the page and went somewhere else (something to think about if you are the #3 player)
http://www.phpied.com/the-performance-business-pitch/
Shopzilla wasn't doing an experiment, they had a slow site and they needed to fix it
big comparison site
100mil impressions aday
8000 requests per sec
Improved response time from 6
down to 1.2
These slides from a deck that was put together for the purpose of explaining performance tuning to business users,
http://thinkvitamin.com/business/fred-wilsons-10-golden-principles-of-successful-web-apps/
Said what they look for in the web apps they invest in
"not just a feature, but the most critical feature"
especially true of non-power users, users that have a choice
As part of their due dillegence they investigate the speed of the app, and they continue to monitor it, like watching a stock ticker.
They know that when the app gets slow, less users use it.
Its a great video, you should check it out
Any discussion of performance monitoring or measurement is met with sneers and the oft quoted 'Premature optimization is the root of all evil'
http://wiki.parleys.com/display/PARLEYS/Home#talk=35061764;title=Common%20Performance%20Antipatterns
I like Donald Knuth
ka-nooth
http://www-cs-faculty.stanford.edu/~uno/faq.html
author of the are of software programming
its true, and its worth reminding ourselves.
We should forget about small efficiencies, say about 97% of the time: Premature optimization is the root of all evil
We should forget about small efficiencies, say about 97% of the time: Premature optimization is the root of all evil
some people quote it, and to them it means even thinking about performance is premature
Let's make a distinction between premature optimization, and baseline measuring.
we're gonna make sure we measure, and tackle the most critical problems
Measuring your performance is not premature optimization
Makes sense for capacity planning
SLA
Should line up with performance expectations of the project
You need to establish the expectations, state your assumptions, and keep an eye on things
why do people say that?
scalability is a term that is thrown around a lot, its meaning becomes unclear, and people make bad decisions because of it
Its possible to have an app with great performance, that can not scale
And its possible to have an app that scales, but its performance is horrible
We need to know what we are measuring
Today we're going to focus on Response time and Requests per second
why do people say that?
scalability is a term that is thrown around a lot, its meaning becomes unclear, and people make bad decisions because of it
Its possible to have an app with great performance, that can not scale
And its possible to have an app that scales, but its performance is horrible
why do people say that?
scalability is a term that is thrown around a lot, its meaning becomes unclear, and people make bad decisions because of it
10 workers = 20req sec
If latency goes up to a full sec...
Its possible to have an app with great performance, that can not scale
And its possible to have an app that scales, but its performance is horrible
This kind of queuing and delay is what we want to eliminate, it represents time not working, just waiting
Here's your typical stack
at each one of these layers there are performance considerations
Our goal will be to get each layer to do less work, and distribute the load from busy workers to not so busy workers
Traditionally, performance tuning focuses on the backend, as it is logical that dynamic data takes more effort to serve up
How do we know if our site is slow?
What is it doing?
waterfalls from
zoompf
How do we know if our site is slow?
What is it doing?
How do we know if our site is slow?
What is it doing?
steve souders
steve souders
http://stevesouders.com/cuzillion/
steve souders
now we have 2 tools that allow us to measure the speed of our app
anyone on the team can do it.
I encourage you to test out your apps, if you haven't already
look up your competition, industry, etc
You can ask showslow to check on a site for you everyday
There is so much to cover, and I want to make sure that everyone gets something valuable out of this talk, whether you are just starting out, or you work for Groupon, serving mils of hits a day.
My main objective is to help you get started. To know where to look, which tools to use, which techniques to investigate, and where to find the resources you need.
I won't be able to teach you everything about performance, but I can at least get you excited, and point you in the right direction.
If i don't teach you something new, or you don't get what you were looking for, please come up and talk to me. We can chat afterwards, if you have a specific issue, I'm sure I can help you out.
www.stubornella.org
netflix saw 43% decrease in bandwidth after they turned on compression
google ajax library allows you to load local files, great when you are on the train
to minimize delays due to network performance, and the browsers limitations on parallel downloads, we want to reduce http calls
google ajax library allows you to load local files, great when you are on the train
to minimize delays due to network performance, and the browsers limitations on parallel downloads, we want to reduce http calls
There is so much to cover, and I want to make sure that everyone gets something valuable out of this talk, whether you are just starting out, or you work for Groupon, serving mils of hits a day.
My main objective is to help you get started. To know where to look, which tools to use, which techniques to investigate, and where to find the resources you need.
I won't be able to teach you everything about performance, but I can at least get you excited, and point you in the right direction.
If i don't teach you something new, or you don't get what you were looking for, please come up and talk to me. We can chat afterwards, if you have a specific issue, I'm sure I can help you out.
no instrumentation
Rawk
Pl_analyze
Splunk
There is so much to cover, and I want to make sure that everyone gets something valuable out of this talk, whether you are just starting out, or you work for Groupon, serving mils of hits a day.
My main objective is to help you get started. To know where to look, which tools to use, which techniques to investigate, and where to find the resources you need.
I won't be able to teach you everything about performance, but I can at least get you excited, and point you in the right direction.
If i don't teach you something new, or you don't get what you were looking for, please come up and talk to me. We can chat afterwards, if you have a specific issue, I'm sure I can help you out.
Images from ihower presentation
Make sure you repeat their question
what we couldn't cover this time, but might make for the latter half of a full day's tutorial...