Answer the question
In order to leave comments, you need to log in
How can I use the GPU in all calculations along with the CPU search in txt files?
Good afternoon,
tell me how can I use the power of my graphics card to search in text files? There are a lot of files, the search is required to be carried out as quickly as possible.
Answer the question
In order to leave comments, you need to log in
We need a controller (PHP) that will accept a request (AJAX) and issue data (JSON). Suppose there is an ajax.php file and a function renderMap
that will plot points on the map
. Next, two handlers (JQUERY):
1) Loads a list of cities by passing ajax.php GET request.
Request: site.ru/ajax.php?type=get_cities
Result ["moscow","perm","samara"]
2) Loads the list of points for the map by passing ajax.php GET request.
Request: site.ru/ajax.php?type=get_marks&city=moscow
Result {"count":1,"marks":{"3758":"55.7146,37.6470"}}
Well, after the second request, call the callback to the renderMap
PS function For those who say "it was necessary to specify everything through the ID, etc." - yes, that's right, but it will be more difficult for a person to understand this than as I wrote above
It's simple: they want to see primitive work with the frontend and backend from you. They want to see how you load data on an event into the second list via AJAX and how you process all this in the backend.
Are you sure that the problem is in the CPU, and not in the speed of reading the file from the disk?
Especially considering that there are a lot of files?
The GPU is a rather specific thing, the meaning of using it for such an operation is not very visible.
How can I use the GPU in all calculations along with the CPU search in txt files?Of course you can use it.
There are a lot of files, the search is required to be carried out as quickly as possible.Means it is necessary to build an index.
search is required to be carried out as quickly as possible
find/make a text search algorithm using the GPU and apply it in your tasks.
I'm not sure what you will find, because the GPU is focused on slightly different tasks (more mathematical).
but try.
It seems to me, business rests against I/O, instead of percents. And to find out for sure, remove the load metrics of the processor, memory, percentage of disk usage (not volume, of course, but what is called busy in atop)
The GPU can not be used for this task in any way. But you can do it very quickly if you have hands and a head and the following:
1) An extremely fast disk, even better if it is a ram disk in a very fast RAM
2) multi-core percent.
3) software in which extremely understanding people took into account all the plugs, context switches between cores, the number of calls to unnecessary system apis, found the fastest option for finding matches (regular or conditions) and many other subtleties.
In your case, plugging in 99% will already be just at the drive stage. it is unlikely to provide such a speed to utilize even an average percentage, and even with an average scall program.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question