performance,optimization,seo,google-pagespeed , Page Speed - Eliminate render-blocking

Page Speed - Eliminate render-blocking


Tag: performance,optimization,seo,google-pagespeed

I'm trying to improve my Google Page Speed score. Currently 51/100 for mobile and 83/100 for desktop.

One of the issues is "Eliminate render-blocking JavaScript and CSS in above-the-fold content". The two items where this is applicable is my minified CSS file and an external Google font file. Is there anything I can do to fix this?

More generally, any feedback / suggestions on how I can improve my Google Page Speed Score.

Page Speed:

My site:



Optimising "Render-Blocking" elements is more about perceived load time as opposed to maximising pagespeed.

For CSS, this involves inlining CSS for your critical css. This is often referred to as 'Above-the-fold' content, though that terminology is incorrect - Critical CSS involves base styles, layout (i.e. grid system) etc.

Here is a Critical CSS Generator available online (and on GitHub):

The reason why you do this is to ensure that the most important styles of your page load with the HTML, and the added file size to HTML should be negligible with gzipped web pages.

The other Rendering issue is with Google Fonts, which is very common. Ignore Google's Advice on this; what it recommends is to place the Google Fonts in the footer.

A better way is to simply generate the web-font yourself using a tool like Font Squirrel Webfont Generator to save the HTTPS Request to Google (which causes a traffic jam in loading your assets.)

However, The Pagespeed Tool is neglecting the main reason your webpage speed suffers: You have 68 HTTP Requests. About a third of these are JS fles, which should be either aggregated into one .js file or using a library like Lab.js to defer js* rendering to reduce HTTP Requests for these files.

*If you use a blocking/loading library like Lab.js, you would have to inline critical Javascript within script tags in your HTML or exclude key js files from being deferred.

As for the Mobile Score, the Google Pagespeed tool is misreading your website as mobile unfriendly. Testing this on another internal page your score is ~74 for mobile.

This is probably due to it timing out and thinking the whole page is rendered or something like that - when using tools like these always do more than one page because they can make mistakes.

Most of your mobile issues would be fixed by inlining your css and deferring your Javascript.

P.S. Don't get too obsessed with the score, most of the things that take marks against you are minor (i.e. less than 5%) adjustments for images, css etc.


Fastest way to draw sprites in opengles 2.0 on android

So Im trying to figure out how to draw a single textured quad many times. My issue is that since these are create and deleted and every one of them has a unique position and rotation. Im not sure a vbo is the best solution as I've heard modifying buffers...

Universal function for getting all unique pairs, trebles etc from an array in javascript

I am looking to create a function in javascript, which would allow me to pass a long array, together with one argument. what I'm looking for is something like this: var ar = [1,2,3,4]; var pairs = superAwesomeFunction(ar,2) //=> [[1,2],[1,3],[1,4],[2,3],[2,4],[3,4]]; var trebles = superAwesomeFunction(ar,3) //=> [[1,2,3],[1,2,4],[1,3,4],[2,3,4] ideally, the function would...

Reading from DATA file handle

My perl module needs to use a look up table that's about 309,000 lines long. Currently the part that loads the table into an array looks (roughly) like this: use strict; use warnings; # load all the data from below my @ref_data; while (<DATA>) { push @ref_data, $_ } close...

How to model data for in-memory processing

I have a lot of static data (i.e. read only data, which is not transactional) which gets updated only once in few days. I have to support searches on that data (api calls, not sql). So I am thinking I will just load it in Memory, and refresh the in-memory...

How can I minimize this function in R?

I'm attempting to write a formula that will determine a value of a that minimizes the function output myfun (i.e. a-fptotal). MWE: c <- as.matrix(c(.25,.5,.25)) d <- as.matrix(c(10000,12500,15000)) e <- 700 f <- 1.1 tr <- .30 myfun <- function(a) { b <- max(a-e,0) df <- data.frame(u1=c(c*b*.40),u2=c(c*b*.60)) df$year <- 1:nrow(df)...

Load js files from the web or serve them yourself?

I have had this question for awhile and am surprised that I have yet to come across a good/complete answer to it. The question is essentially this: When it comes to loading js files, in what situations should you load them from the web if available versus serving them up...

How can I optimize filename generator with underscore?

I have this code def filename_generator(name, path=''): names = [] for i in range(len(name)): p = '_'.join([x for x in name[i:]]) + path names.append(name[:i] + p) names += filename_generator(name[:i], p) return sorted(list(set(names))) for e in filename_generator('longlonglonglonglonglongname'): print(e) How can you see, i need generate all combinations of filename with underscore...

PageSpeed Insights : Load css files after the closing

Google Page insight tells us to optimize CSS file like this : Vous pouvez alors incorporer le code CSS essentiel comme ceci : <html> <head> <style> .blue{color:blue;} </style> </head> <body> <div class="blue"> Hello, world! </div> </body> </html> <link rel="stylesheet" href="small.css"> source : The French link is I’ve never...

Should I pass all the state in every change from store to component?

I am new on React and Flux and I am making an app that will have an input (like the name or the title), and below a list of n things. How should I handle the event listeners? I saw in the TODO example of flux ( that they use...

Can not increase max_open_files for Mysql max-connections in Ubuntu 15

I am running this version of Mysql Ver 14.14 Distrib 5.6.24, for debian-linux-gnu (x86_64) On this version of Ubuntu Distributor ID: Ubuntu Description: Ubuntu 15.04 Release: 15.04 Codename: vivid This is the config I set for Mysql: key_buffer_size = 16M max_allowed_packet = 16M thread_stack = 192K thread_cache_size = 8 innodb_buffer_pool_size=20G...

MySQL - How can I know my query is tuned?

I'm creating a DB from scratch and I'm trying to create queries with performance in mind. For test purpose I filled my tables with test data. My query needs to join 3 tables: 2 with millions of rows and the third with hundred thousands rows. How can I know my...

Synchronize local SQLite database with central database

We are developing an Android App based on a product that already has a website. As a result, when launching the Android app it may happen that a lot of things differ between the local SQLite database and our central database. What is the fastest way to synchronize the Android...

Dynamic creation of objects vs storing them as fields

I have this loop which runs about 1,000,000 times. while ((line = br.readLine()) != null) { if(!(line.isEmpty())){ data = new JSONObject(line); name = (String)data.get("name"); surname = (String)data.get("surname"); ar.put(name, surname); //an array } } What are the advantages (if any) in terms of efficiency of having it like that were data,name...

What would be the fastest way to insert this data

Okay, so I have a MySQL table called entries which contains the columns name VARCHAR(255) NOT NULL and address VARCHAR(255) The table has about a million sets of data. For every set of data, name has a value e.g. "john" whilst address is NULL. For example: +------+---------+ | name |...

Fast access to matrix as jagged array in C#

I've created a lower triangular distance matrix (because of size issues) as jagged array Note: Distances between objects are symmetric var dm = new double[size][] for (var i = 0; i < size; i++) { dm[i] = new double[i+1]; for (var j = 0; j < i+1; j++) { dm[i][j]...

Best data type for list of ?

What's the best data type performance-wise for a list of tuples composed of <ID, object>, such that the IDs are not unique? For example: 1 tire 1 rim 1 spoke 2 buckle 2 flap 2 bag What would give the best performance when selecting for ID = 1? I have...

performance of executing openjpa query

I have a rest web app with cxf 3.0.1 framework and openjpa 2.3.0. The web.xml: <web-app xmlns="" xmlns:xsi="" xsi:schemaLocation=""> <display-name>Mobile app rest services</display-name> <context-param> <param-name>contextConfigLocation</param-name> <param-value>WEB-INF/cxf-servlet.xml</param-value>...

use empty() or just use > in php which is the fastest way

I am trying to check the value of a variable if it is not NULL nor 0 to show its value $saleprice = $product["product_details"][0]->salePrice; I know that using if(!empty($saleprice) ) echo " on sale , sale price : $saleprice "; or if((int)$saleprice > 0) echo " on sale , sale...

SQL Server Query Performance with Timestamp and variable

I have a simple SQL query to count the number of telemetry records by clients within the last 24 hours. With an index on TimeStamp, the following query runs in less than 1 seconds for about 10k rows select MachineName,count(Message) from Telemetry where TimeStamp between DATEADD(HOUR,-24, getutcdate()) and getutcdate() group...

Insert multiple rows into MySQL table

I have a table as follows: CREATE TABLE IF NOT EXISTS mytable ( `id` INT(22) NOT NULL AUTO_INCREMENT, `name` VARCHAR(255) NOT NULL, `uuid` VARCHAR(255) NOT NULL, `x` INT(11) NOT NULL, `y` INT(11) NOT NULL, `z` INT(11) NOT NULL, `time` BIGINT NOT NULL, PRIMARY KEY (`id`), UNIQUE KEY idx_table_x_y_z ( x,...

How to make this code more performant?

I have this snippet of code that iterate over a map and filter some fields based on relation type, I have to run two loops and have a feeling that it is going to be slow for big maps. Is there any way I can technique/refactoring to make this code...

Messaging table performance - Merge from and to id`s into one single field vs separate 2 fields

What would be the implications on performance on merging the users id from the "messages" table in form of "fromto" - ex userID - 5, userID 9 => "59" versus having two separate columns "from" and "to"? Flow - list, read, delete messages when both id`s will be available in...

MySQL JOIN / IN performance optimization

I have a following MySQL query: SELECT p.post_id, p.date_created, p.description, p.last_edited,, p.link_description, p.link_image_url, p.link_title, p.total_comments, p.total_votes, p.type_id, p.user_id FROM posts p JOIN posts_to_tribes ptt ON p.post_id=ptt.post_id WHERE ptt.tribe_id IN (1, 2, 3, 4, 5) GROUP BY p.post_id ORDER BY p.last_edited DESC, p.total_votes DESC LIMIT 25 In a non-concurrent environment...

Speeding up a SQL query with indexes

I have a table called Products. This table contains over 3 million entries. Every day there are approximately 5000 new entries. which only happens during the night in 2 minutes. But this table gets queried every night maybe over 20 000 times with this query. SELECT Price FROM Products WHERE...

(Automatically) convert SQL strings to 'enums'?

We have a PostgreSQL database with billions of entries in the form: CREATE TABLE entry ( session integer NOT NULL, time integer NOT NULL, key text NOT NULL, data text NOT NULL ) In this database key is a developer-defined string, while data is user-defined content. In other words, while...

(WHY?) Greatest+Coalesce way faster than a single select with or

I'm currently having a hard time unterstanding why this: greatest( coalesce((select f.expReplDate from da_sakunden_fzg f where (f.ServerNr = k.ServerNr) and (k.proId = f.proId) order by f.expReplDate limit 1),0), coalesce((select f.expReplDate from da_sakunden_fzg f where (f.ServerNr = k.ServerNr) and (k.proId = f.ownerProId) order by f.expReplDate limit 1),0) ) as WMZ is...

make all elements in list equal with minimal cost

I am trying to create a prolog program that allows to convert a list into a list with the same length consisting of only 1 element from the original list. This element must be chosen in such a way that a minimal number of elements from the original list needs...

Prevent upvote model from being called for every comment

I have three models: User, Comment and Upvote. User-to-Comment has a one-to-many relation, Comment-to-Upvote has a one-to-many relation and User-to-Upvote has a one-to-many relation. I want to do something similar to the upvoting done on Stackoverflow. So when you upvote/downvote the arrow will highlight and remain highlighted even if you...

Why is Java faster if it repeats the same code?

Given the following code: public class Test{ static int[] big = new int [10000]; public static void main(String[] args){ long time; for (int i = 0; i < 16; i++){ time = System.nanoTime(); getTimes(); System.out.println(System.nanoTime() - time); } } public static void getTimes(){ int d; for (int i = 0;...

What is difference between join syntax in T-SQL [duplicate]

This question already has an answer here: ANSI vs. non-ANSI SQL JOIN syntax 6 answers This is my SQL query: SELECT last_name, department_name FROM employees e, departments d WHERE e.department_id = d.department_id; And: SELECT last_name, department_name FROM employees e INNER JOIN departments d ON e.department_id = d.department_id; What is...

Performance difference between pattern matching and if-else

Why can OCaml generate efficient machine code for pattern matching and not for if-else tests? I was reading Real World OCaml and I came across this section where they compared the performance of pattern matching to the performance of if-else tests. It turned out that pattern matching in their example...

Angular ng-repeat cache (avoid re-rendering on state change)

We have huge rendering spikes with ng-repeat in Angular application. Main page shows a huge list of cover images ("::" and "track by" are in place). On first load it works acceptable. But if user changes the state (we use UI-Router) and goes back to the home page afterwards then...

optimization algorithm for circular data

Background: I am interested in localizing a sound source from a suite of audio recorders. Each audio array consists of 6 directional microphones spaced evenly every 60 degrees (0, 60, 120, 180, 240, 300 degrees). I am interested in finding the neighboring pair of microphones with the maximum set of...

type conversion performance optimizable?

The following snippet converts xml data to csv data in a data processing application. element is a XElement. I'm currently trying to optimize the performance of the application and was wondering if I could somehow combine the two operations going on below: Ultimately I still want access to the string...

Java: Assigning a variable its current value?

If I have a string that is currently empty String s = ""; and reassign it s = ""; is it bad it I don't do it like this? if(!s.isEmpty()){ s = ""; } or will the compiler pick up on it and optimize for me?...

Dynamic programming: how to design algorithm for when there are two factors to consider?

I have the following problem and I only have a slight idea about it: Consider a tape storage problem. Given n files of length l1,...,ln and frequencies with which they are accessed f1,...,fn, where sum of all frequencies is 1 and 0<fi<1. "Optimal" means to minimize the average retrieval time...

FastDOM - Read / write every 17ms?

FastDOM - a small library that batches DOM reads & writes into raf (requestAnimationFrames). I have read the code, however, I am struggling to understand how it works. Here are a few presumptions we have: - Browsers are generally set to 60fps - So in total, there can be...

Pygame 3D: How to and is it possible?

So I want to program a 3d-mesh viewer in pygame, no other 3rd-party modules wanted (panda3d is perfect, but it's very complicated). My idea is: list_of_surfs = {'85 50':'70deg'} #the 85 50 and the dimensions of the #side/surf, and 70 deg of rotation to be able to see it, then...

In general, how expensive is calling an external program?

I know external programs can be called, but I don't know how expensive it is compared to, say, calling a subroutine. By the cost of calling, I mean the overhead of starting the program, rather than the cost of executing the program's code itself. I know the cost probably varies...

Picking Ad Mob Mediation Networks 2015

Looking to setup network mediation on AdMob. There are a lot of networks on the list - so I'm looking for some sort of comparison of the networks or recommendations on setting up mediation such as: how many networks to use etc... I plan to utilize simple 320x50 ad banner...

Ontologies, OWL, Sparql: Modelling that “something is not there” and performance considerations

we want to model that "something is not there" as opposed to missing information, e.g. an explicit statement that "a patient did not get chemotherapy" or that "a patient does not have dyspnea" is different from missing information about whether a patient has dyspnea. We thought about several approaches, e.g....

OpenCV FAST corner detection SSE implementation walkthrough

Could someone help me understanding the SSE implementation of the FAST corner detection in OpenCV? I understand the algorithm but not the implementation. Could somebody walk me through the code? The code is long, so thank you in advance. I am using OpenCV 2.4.11 and the code goes like this:...

How to count the number of zero decimals in javascript?

How do I get the number of zero decimals behind the comma (but not the total)? So to illustrate an example: 0.00001 > 4 0.000015 > 4 0.0000105 > 4 0.001 > 2 I am looking for methods that are efficient (meaning that they optimize the calculation time)....

Mysql query using subselects needs to use joins or exists

NOTE If your going to downvote my question that I clearly put a lot of time into, can you please at least tell me why so I can avoid any mistakes in the future? Thank you. Update At the suggestion of @DRapp I am adding an explanation as to what...

Why does the java DirectoryStream perform so slow?

I've done some testing with Streams in special with DirectoryStreams of the nio-package. I simply try to get a list of all files in a directory sorted by last modified date and size. The JavaDoc of old File.listFiles() stated a Note to the method in Files: Note that the Files...

One-dimensional binpacking algorithm with relative costs

I'm wondering how to solve "One-dimensional binpacking problem with relative costs". We pack N volumes (with given sizes) into M bins (with given capacities) and have the matrix (NxM) of costs of each volume per each bin. So, the total cost should be minimized. Can you advice any algorithm for...

performance issues executing list of stored procedures

I'm having some performance issues when starting my windows service, the first round my lstSps is long (about 130 stored procedures). Is there anyway to speed this up (except for speeding the stored procedures up)? When the foreach is over and goes over to the second round it goes faster,...

Do you get the same performance using index prefixes?

Say I have a collection containing documents like the one below: { _id: ObjectId(), myValue: 123, otherValue: 456 } I then create like below: {myValue: 1, otherValue: 1} If I execute the following query: db.myCollection.find({myValue: 123}) will I get the same performance with my index as I would if I...

How to print iterations per second?

I have a small Python script which sends POST requests to a server and gets their response. It iterates 10000 times, and I managed to print the current progress in command prompt using: code=current_requestnumber print('{0}/{1}'.format(str(code),"10000"),end="\r") at the end of each loop. Because this involves interaction with a webserver, I would...