prefetch

Detect Google Chrome page prefetch

大兔子大兔子 提交于 2019-12-05 16:25:42
I am building a simple tool that tracks and increases the number of visits of a website. It's something simple as: When the server receives a GET request, it will increase the counter in database for that website by 1. However, I am running to a bit problem with Google Chrome's pre-render engine ("Predict network actions to improve page load performance"). The website is www.domain.com, and as soon as you type the domain name www.domain.com into the browser's address bar (without pressing Enter), Chrome sends a GET request to prefetch the page, resulting in the server logging that visit and

Oracle JDBC prefetch: how to avoid running out of RAM

…衆ロ難τιáo~ 提交于 2019-12-05 09:40:48
Using Oracle java JDBC (ojdbc14 10.2.x), loading a query with many rows takes forever (high latency environment. This is apparently the default prefetch in Oracle JDBC is default size "10" which requires a round trip time once per 10 rows. I am attempting to set an aggressive prefetch size to avoid this. PreparedStatement stmt = conn.prepareStatement("select * from tablename"); statement.setFetchSize(10000); ResultSet rs = statement.executeQuery(); This can work, but instead I get an out of memory exception. I had presumed that setFetchSize would tell it to buffer "that many rows" as they come

how to test prefetch/prerender

痴心易碎 提交于 2019-12-05 02:14:46
I have started to load a few key resources and pages using the prefetch/prerender system. Is there a way to ensure that the resources in question are actually being preloaded? Google recommends using the Page Visibility API to test if a page is being prerendered. I'm not sure how well it works cross-browser (but what does in HTML5). You can also use prerender-test.appspot.com to test that your site works correctly under prerendering. Further, from within Chrome, you can go to chrome://net-internals#prerender to see a list of attempted prerenders and whether they were used, and if they were not

Can link prefetch be used to cache a JSON API response for a later XHR request?

爷,独闯天下 提交于 2019-12-04 23:36:07
Given a JSON API endpoint /api/config , we're trying to use <link rel="prefetch" href="/api/config"> in the head of an HTML document. Chrome downloads the data as expected when it hits the link tag in the HTML, but requests it again via XHR from our script about a second later. The server is configured to allow caching, and is responding with Cache-Control: "max-age=3600, must-revalidate" in the header. When Chrome requests the data again, the server responds correctly with a 304 Not Modified status. The use case is this: the config endpoint will always be requested from the Javascript in our

Scenarios when software prefetching manual instructions are reasonable

人走茶凉 提交于 2019-12-04 16:13:02
I have read about that on x86 and x86-64 Intel gcc provides special prefetching instructions: #include <xmmintrin.h> enum _mm_hint { _MM_HINT_T0 = 3, _MM_HINT_T1 = 2, _MM_HINT_T2 = 1, _MM_HINT_NTA = 0 }; void _mm_prefetch(void *p, enum _mm_hint h); Programs can use the _mm_prefetch intrinsic on any pointer in the program. And The different hints to be used with the _mm_prefetch intrinsic are implementation defined. Generally said is that each of the hints have its own meaning. _MM_HINT_T0 fetches data to all levels of the cache for inclusive caches and to the lowest level cache for exclusive

How do I list objects for Typeahead.js and/or with the Bloodhound engine?

孤街醉人 提交于 2019-12-04 14:17:07
I'm having a hard time figuring out how to display a list of objects using typeahead with a json file as the source. None of my data is being displayed. I want to list the names, and use the other attributes for other things when selected. ../data/test.json [ {"name": "John Snow", "id": 1}, {"name": "Joe Biden", "id": 2}, {"name": "Bob Marley", "id": 3}, {"name": "Anne Hathaway", "id": 4}, {"name": "Jacob deGrom", "id": 5} ] test.js $(document).ready(function() { var names = new Bloodhound({ datumTokenizer: Bloodhound.tokenizers.whitespace("name"), queryTokenizer: Bloodhound.tokenizers

Prefetch for Intel Core 2 Duo

本秂侑毒 提交于 2019-12-04 10:00:47
Has anyone had experience using prefetch instructions for the Core 2 Duo processor? I've been using the (standard?) prefetch set ( prefetchnta , prefetcht1 , etc) with success for a series of P4 machines, but when running the code on a Core 2 Duo it seems that the prefetcht(i) instructions do nothing, and that the prefetchnta instruction is less effective. My criteria for assessing performance is the timing results for a BLAS 1 vector-vector (axpy) operation, when the vector size is large enough for out-of-cache behaviour. Have Intel introduced new prefetch instructions? From an Intel

programmatically disable hardware prefetching on AMD systems

谁都会走 提交于 2019-12-04 05:15:17
is there a way to programmatically disable the hardware prefetcher on an AMD system like you can in an Intel system as discussed in this topic Specifically for the AMD Opteron Barcelona or Istanbul architecture. All AMD Family 10h processors (including Barcelona and Istanbul) have two different hardware prefetchers. The first is the traditional data cache prefetcher that recognizes contiguous streams of either ascending or descending cache line accesses. It can be disabled by setting bit 13 of MSRC001_1022 to "1". The other hardware prefetcher is the "memory controller prefetcher". This is a

Cost of a sub-optimal cacheline prefetch

狂风中的少年 提交于 2019-12-04 03:19:51
What is the cost of a late prefetch done with a __builtin_prefetch(..., 1) intrinsic (prefetch in preparation for a write)? That is, a prefetch that does not arrive in the L1 cache before the demand load or write that requires it? For example void foo(std::uint8_t* line) { __builtin_prefetch(line + std::hardware_constructive_interference_size, 1); auto next_line = calculate_address_of_next_line(line); auto result = transform(line); write(next_line, result) } In this case if the cost of transform is lower than the prefetch, will this code end up being less efficient than if there were no

How to prefetch image in GWT?

浪子不回头ぞ 提交于 2019-12-04 02:18:34
I tried the following code: RootPanel root = RootPanel.get("root"); root.clear(); final FlowPanel p = new FlowPanel(); root.add(p); for (int i=0; i<20; ++i) { String url = "/thumb/"+i; final Image img = new Image(url); img.addLoadHandler(new LoadHandler() { @Override public void onLoad(LoadEvent event) { p.add(img); } }); Image.prefetch(url); But it does not work for me. Did I missed something? Image load handler is called only in the case, when image is attached to the DOM. So you have to add image to the DOM outside the loadHandler: p.add(img); img.addLoadHandler(new LoadHandler() {