Most voted "optimizing" questions
In programming, optimization typically takes the form of increasing the speed of an algorithm, or reducing the resources it needs.
Learn more…134 questions
Sort by count of
-
4
votes1
answer362
viewsStructure for PHP project and use of the Eval() function
I need to develop an application that fits several projects with common functionalities, however each has several specific rules. What I need is a structure that allows me to easily change these…
-
4
votes0
answers82
viewsHow to optimize the site according to analysis response?
I recently blogged for my wife, https://danielafolle.com.br/ which I am now working to optimize the response time of the site. I’m using the Pagespeed Insights Google to base if I’m progressing on…
-
4
votes1
answer395
viewsHow to vector code in C++?
Would you like to know how to vector code in C++ ? because the material I found on the internet is a bit excasso. I understand as vectorization the use, not only of vectors, but of doing in a single…
-
4
votes2
answers253
viewsIs it OK to use a switch inside a for?
Came to me a question related to the use of a switch within a for. I saw that it works for my purpose but this is correct to do in the world of programming? There is a better way to get the result…
-
3
votes1
answer534
viewsIndex for MYSQL - ORDER BY influence when creating an index?
I have the following query: SELECT type,name,points FROM clients WHERE type='1' ORDER BY name I created an index for the "clients" table only above the "type field". Adding an ORDER BY on top of a…
-
3
votes1
answer2299
viewsHow to clear Mysql’s cache of queries?
How do I clear the cache of darlings, stored by Mysql? What is the command?
-
3
votes4
answers343
viewsWhy not always use Optimize Code?
In Visual Studio there is the option Optimize Code which has the function of creating optimizations performed by the compiler to make your output file smaller, faster and more efficient. Why can’t I…
-
3
votes4
answers934
viewsHow can I decrease program processing time?
I need to show this exit: 1 2 3 PMU 5 6 7 PMU 9 10 11 PMU 13 14 15 PMU 17 18 19 PMU 21 22 23 PMU 25 26 27 PMU #include<stdio.h> #include<stdlib.h> #include<math.h>…
-
3
votes1
answer687
viewsHow does the frame-Pointer work?
In the official GCC documentation there is a option that allows you to remove the frame-Pointer when it is not necessary. What the frame-Pointer ago? How removing this pointer can improve…
-
3
votes1
answer842
viewsBest way to structure history table with large amount of data
Functional requirement I own devices. Each device roughly has its unique identifier, an IP address, and a type. I have a routine of pings for every device that has an ip address. This routine is…
-
3
votes1
answer562
viewsHow to optimize Hibernate query
I am developing a system in JAVA and use Hibernante to generate my queries with the bank. I need to solve the following problem: I have some classes that belong to an entity and I need to execute a…
-
3
votes0
answers92
viewsOptimization of poorly compiled
I set up Visual Studio to compile VC++ with /Ox and compiled this code (with more others that were omitted to simplify). union { unsigned long long u64 ; unsigned short u16[4] ; } x ; union {…
-
3
votes2
answers1419
viewsCreate and assign loop variables For
How to make this logic within a loop FOR ? var G1 = $('#G1').text() var G2 = $('#G2').text() var G3 = $('#G3').text() console.log("NaN") console.log(G1+"\n"+G2+"\n"+G3) console.log(G1+G2+G3) G1 =…
-
2
votes1
answer307
viewsUPDATE and SELECT at the same time (locked)
Monitoring the database (Mysql) through Monyog I realize that when some very large query is executed (SELECT) and, at the same time, an update query also runs, under the same table, the update is…
-
2
votes1
answer546
viewsRandom results in SQL queries without repeating (Scroll Infinity)
I’ve had this problem for a long time and I can’t fix it. I have a page with infinite scroll that returns some rows from the database, but the results most often repeat. I’m using the following…
-
2
votes4
answers930
viewsOptimize loading of images
Good morning, I have a Bootstrap Carousel that occupies the entire screen. I would like to know the methods used to optimize the loading of the images of this Carousel and the page as a whole. I am…
-
2
votes1
answer74
viewsWanted to know how to create variables through for in javascript?
because I am creating a page with javascript that has a lot of variaves that changes just like in the excerpt below var divClearFloat1 = document.createElement("DIV"); var divClearFloat2 =…
-
2
votes0
answers535
viewsDynamic Javascript date mask
Recently I had to perform a mask for dates with automatic filling, I searched a lot and did not find answers that solved my doubts. When typing '4' in the first field, the '0' should already be…
-
2
votes2
answers151
viewsHow to optimize images?
I was following some advice from Google’s Pagespeed Insights and one of them is: Properly formatting and compressing images can save many bytes of data. However I have already optimised them with a…
-
2
votes0
answers237
viewsHow to load css files asynchronously?
Well, I put the link to my website, to be analyzed on Pagespeed and to fix optimization issues and etc.. And for the javascript, was pointed out that it needed to be corrected Delete rendering lock…
-
2
votes1
answer448
viewsDecrease SQL database size [Oracle] - ORA-12953
I am working on a local Oracle XE database. But it has reached the 11 GB limit. ORA-12953: The request exceeds the maximum size allowed for the database, which is 11 GB. It turns out I deleted…
-
2
votes1
answer42
viewsI deleted old posts and the database was almost the same size
I have a database with news posted since 2015. I decided to delete the posts, leaving only the last 30 days. With this, I expected the database to reduce in size and this did not happen. Look how I…
-
2
votes2
answers136
viewsHow does -O3 optimization break some programs?
When compiling my own programs, I have the freedom to change some flags compiler and start using optimization -O3. This optimization manages to break some programs. I understand that the compiler…
-
2
votes1
answer419
viewsWhat is the best type of file compression to optimize server response?
Recently I have been researching ways to improve the server performance, decreasing its load and consequently increasing its speed. I found several types of compression and benchmarks comparing the…
-
2
votes1
answer344
viewsJoin three similar codes into one
I am working with a table that shows the number of vacancies offered, candidates enrolled and enrolled in higher education courses. I want to make a program that allows the visualization of this…
-
2
votes0
answers487
viewsCalculate file size of a dataURL (cost)
I’m uploading an image to Base64 (dataURL) for an application that uses express. As the user is doing the "cropping" of this image on the front end I found no other way to send but by dataURL... the…
-
2
votes1
answer1214
viewsHow to copy values from one vector to another quickly
I’m making a question that the number of elements in the vector are in 10 6 and just wanted to copy certain element to it only that I did the normal way, but common, there is another possibility if…
-
2
votes0
answers66
viewsTips to optimize Select in SQL. Does the conditional order in Where matter?
Do you have any tips for optimizing Select in sql? If I search a table with over 500,000 or 1 million records, is there any way to optimize my search so that it doesn’t spend too much server…
-
2
votes1
answer130
viewsOptimization with GCC
Recently I was wondering if it is possible to compile with some flag optimization, avoid copying two arrays for the section .rodata? Thus, memory addresses would be equal, example const char str[7]…
-
1
votes1
answer172
viewsIs there a tool to help optimize the layout?
It is sometimes common to doubt which layout to use, which graphic resources consume the most memory, and how to improve the layout in which the views appear. Is there any tool to help in the…
-
1
votes3
answers749
viewsHow to optimize the query in a remote bank using Clientdataset?
I’m using a Clientdataset for consultation in a remote database, the table has more than 100 thousand records and this getting very slow, the SQL I am using is: select (coalesce (cast(A.con_baixa as…
-
1
votes1
answer118
viewsOptimization of Cache Memory usage
I received a code implementing Dijkstra in C, and my mission is to optimize this code. The code is this: #include <stdio.h> #include <stdlib.h> #include <string.h> #define…
-
1
votes1
answer100
viewsJava problem in Mathcad and Modefrontier integration
I’m testing the modeFrontier with a simple multi-purpose optimization problem of ESTECO A simple multi-objective Optimization problem Modefrontier can generate input variables h and r but cannot…
-
1
votes0
answers78
viewsOptimization of SQL query time
I have a database that stores precipitation marked by various sensors on certain dates and times over the course of a year. I am making a query, to search all records marked by a single sensor, with…
-
1
votes1
answer109
viewsAndroid how to optimize a large chain of ifs
I would like to know how to optimize a large chain of ifs so that the code becomes more efficient and readable. My Android application uses version 2.3.3 (API 10), in this application I have an…
-
1
votes1
answer408
viewsDifferences between Cache and CDN usage
What are the advantages and disadvantages when using CDN (Content Delivery Network) and Cache and how they can complement each other?
-
1
votes3
answers62
viewsMemory and processing - Variables and verification
Is there a big difference for memory and processing in how to perform the verification in these two examples? If yes, why and how they both behave when executing the codes. Method 1: var exam =…
-
1
votes1
answer1054
viewsHow to optimize this query in Mysql that is too slow?
I’m doing a simple query on LMS Moodle to get the amount of hits from all users. SELECT count(userid) as total, action, userid FROM mdl_logstore_standard_log log WHERE action = 'loggedin' GROUP BY…
-
1
votes0
answers80
viewsHow do I activate resource compression with gzip or deflate on my website?
I cannot activate resource compression with gzip or deflate on my website. On the server the option is already enabled and on .htaccess also, only that page speed still keeps saying that compression…
-
1
votes1
answer38
viewsHow to scale a bitmap quickly
I’m making a game using Surfaceview and I need a bitmap to be , for example ,a size of 20x20 ,but this bitmap is reused in other parts of the code in different sizes ,that is, it would not be…
-
1
votes0
answers131
viewsLinked Server SQL Server Optimization
Currently has an environment that has 4 servers with database. I need to gather some information from 3 servers in 1. Example: The servers are: To B C and D I need to get some information that’s on…
-
1
votes2
answers219
viewsLoop memory and processing optimization
The code is simple and is working perfectly, but wanted tips on how to optimize it, what would be the best methods to use to allocate less memory, best practices, etc. using System; using…
-
1
votes1
answer136
viewsOptimize Java code
Good, I am creating an alarm on android e I wanted to know if inves to have to make a switch for each editText se Avia way to check all on a single switch, I tried with a for and was incremented,…
-
1
votes1
answer254
viewsCompressing and organizing Json
I have been studying Json recently to use in my projects to replace database in some cases, in my tests I found a doubt. depending on the project I may end up repeating some values in certain items…
-
1
votes1
answer212
viewsOptimize module 10 SQL Server
I have a database created by apróx. a decade, this same bank has several records and obviously, by being in production, can not be changed from day to night. The problem is: The products registered…
-
1
votes4
answers103
viewsHow to avoid value repeats in this code?
I made the function below that removes accents from a string using values from an object: function remAcentos(p){ var acc = { // ↓ ↓ ↓ ↓ ↓ 'á': 'a', 'â': 'a', 'à': 'a', 'ã': 'a', 'â': 'a', // ↓ ↓…
-
1
votes1
answer173
viewsSite optimization in PHP/CSS3/HTML5/Mysql
I’m new here, I read about the rules, but I don’t know where to post this, I would like a help, on how to improve the loading of a site developed in PHP/CSS3/HTML5/Mysql, someone indicates a site or…
-
1
votes1
answer41
viewsOptimization of php code (NF key generation)
Dear colleagues, currently I am working on a project that carries out the sending of tax coupons, in it I arrived at a function that generates the key of the nfe, in it I receive the following data:…
-
1
votes0
answers39
viewsHow to optimize search parameters in r?
I’ve been waiting for hours for my code to finish running. I imagine there must be a smarter way to do this, after all I don’t need to visit every point when I have a monotonous function around a…
-
1
votes1
answer29
viewsQuery optimization
Hey there, guys! I have this query (Mysql) to count amount of visits on a Mê in a given period, however it takes more than 1 minute to run. How can I optimize it? Thanks in advance. SELECT…