MillionNovel

Font: Big Medium Small
Dark Eye-protection
MillionNovel > An Expert Is actually By My Side > Chapter 99

Chapter 99

    To be honest, this question really baffles Hao Yun.


    Read a long time topic, he Leng is a line of code did not knock out.


    Optimize the code of "glacier engine"?


    Improve engine efficiency by 10%?


    He hasn''t seen the underlying code of this engine yet


    At the same time, the backstage of the game scene.


    At the request of academician Zhan Yongshu, the staff called up the screen of contestant 101.


    Looking at the fourth question appearing on the screen, Professor Zhang cunhao, standing next to academician Zhan, shook his head with a smile. His voice was rather regretful, but he said without any surprise.


    "I didn''t expect that he chose the fourth question. It seems that it''s completely out of the question."


    "Oh?" Academician Zhan Yongshu raised his eyebrows with great interest.


    "Teacher, you won''t forget that before I went back to Shuimu university to teach, I was working in the front-line position of software R & D Department of Longwei group, right?" Professor Zhang cunhao joked.


    "I haven''t read the specific content of the title yet. Is this glacier engine also a product of your department?"


    "That''s not true. The product itself was developed by an acquired R & D team, but our software R & D department has optimized the product. Now glacier 3.0 is the product after our secondary optimization. Now the mainstream large-scale 3D action games, especially the third person category, are basically made with this engine! " Professor Zhang cunhao said with a touch of pride on his face.


    But he does have the capital to be proud.


    Longwei group is a giant in Xiaguo electronic industry, and its huge software R & D team is one of the factors to lay this foundation. Even if video games are new after the new calendar, none of the software engineers despise them.


    Professor Zhang cunhao''s meaning is very clear.


    Compared with the other three questions that don''t define the acceptance criteria, this one with clear requirements for performance improvement is absolutely impossible!


    Because this is the crystallization of countless software engineers!


    Because this is the product of countless optimization!


    Because this is the most concise code!


    It''s like a work of art, no letter is superfluous!


    Let alone the students sitting here, it is almost impossible for the main examination committee standing here to solve the fourth question in just three days.


    Of course, it will be possible to do it for a longer time.


    "To tell you the truth, this kind of topic even you feel helpless, appears in this kind of competition for college students... Isn''t it a bit inappropriate?" Academician Zhan Yongshu looked at Professor Zhang cunhao and said.


    Professor Zhang cunhao said with a smile, "isn''t it a convention to set up a trap among the four questions in previous competitions? This is also a serious investigation of the players'' own objective situation. I believe that as long as I use my brain a little bit, I can think that there is no chance to optimize this kind of commercial application mature software. "


    Academician Zhan Yongshu laughed and did not speak.


    He might have guessed the reason for using this kind of question as a trap.


    One is that, as Professor Zhang cunhao said, one of the four questions is used to bury people, which is the Convention of the hope cup competition. As for the second, I''m afraid it has something to do with the sponsorship given by Longwei group.


    After all, like the hope cup, which has attracted the attention of countless college students and professionals, no one has made the last big question, which is a great gimmick in itself.


    Use this gimmick to do promotion, more than any hard wide have topic.


    Considering that the whole examination system of this competition is sponsored by Longwei group for free, academician Zhan Yongshu didn''t say anything, just didn''t give much hope to the player on the screen.


    After all, even if he comes by himself, he may not be able to improve the performance of glacier 3.0 engine by 10% in three days. From another point of view, if there is such an easy way to do it, the ice engine development team and the software engineers who are responsible for engine optimization must have thought of it.


    It is also a necessary quality for a programmer to choose the research subject he is good at and avoid those topics that will only waste time and energy.


    If not


    In this competition, player 101 has gone far!


    ……


    Hao Yun didn''t know that he was just reading questions. Several industry leaders standing at the background of the examination room not far away had already foreseen his ending.


    Is that really the end?


    At the beginning, Hao Yun thought so pessimistically.


    After all, it took him a lot of effort to read the whole glacier engine code.


    "First of all, calm down..."


    "Then, you have to figure out the logic of the engine."


    It is an important criterion for a good engine to make the output of graphics data faster and higher quality. It must be in this engine online, glacier engine developers have racked their brains to optimize its code.


    It''s not entirely impossible to make further progress in the efforts of predecessors, but I''m afraid I have to strengthen my system plug-in if I expect to do it in just three days with one person''s strength.


    So


    It is almost impossible to optimize the code of the engine itself.


    I''m afraid my only hope is outside the code of the engine itself.


    For example, the underlying functions that are called frequently?


    Whether it''s a 3D engine or a 2D engine, whether it''s a popular "glacier" in China or a popular "wasteland" abroad, all game engines need to call the underlying functions frequently in the final analysis, and the more the underlying functions are called, the more frequently they are called.


    Especially 3D graphics rendering!


    Sometimes players get stuck in big scenes, and even the characters hang up and go through the wall. In fact, the reason to a large extent is that the speed of graphics algorithms can''t keep up.


    If we can optimize the underlying functions


    Do you really hope to solve this problem?


    For a moment, Hao Yun was frightened by his crazy idea.


    what the fuck?


    He carefully summed it up in his heart, which seems to be more difficult than optimizing the glacier engine!


    After all, the glacier engine is still the product of the first year of the new calendar, but the underlying functions called by the glacier engine have been developed before the era of the people''s League.


    But


    What if it works?


    After swallowing his saliva, Hao Yun, with the idea of having a try, finds the math. C file in the code folder of the glacier engine directory and opens a large number of called functions stored in it.


    It''s obviously unrealistic to read all the code from beginning to end, but Hao Yun doesn''t intend to do such a stupid thing.


    He just needs to find the function that is called the most times when the engine is running, which is called almost every time when the game scene is loaded, and is enough to affect the efficiency of the engine, and then go inside to look for opportunities for improvement.


    Soon, Hao Yun locked a path named Q_ Function of sqrt.


    On the surface, this function looks ordinary, but it''s just an algorithm that uses Newton''s iterative method to find the reciprocal of the square root.


    Interestingly, however, in the course of running this engine, the need to find the reciprocal of the square root of the situation to an appalling degree.


    Therefore, from another point of view, the operation speed of this function is enough to affect the efficiency of the engine itself.


    This is like a screw on a space rocket. On the surface, the speed of the rocket does not depend on the screw itself, but on the design of the rocket engine and the key fuel. However, when the design of the rocket engine and the fuel technology have developed to a bottleneck, if we want to further improve the efficiency of the rocket, we have to start from the fundamental materials.


    What Hao Yun is doing at this moment is a similar thing.


    However


    Although ideas have been found, it is not easy to get through this road.


    So far, there is nothing worth digging. After all, Newton iterative method itself is a very good mathematical method for finding the reciprocal of square root.


    Think about innovation again?


    It''s almost impossible to improve the mathematical method!


    If you want to be faster than this, I''m afraid you have to build a huge database of input and output values.


    However, building a library for just one function seems to put the cart before the horse


    As time went by, Hao Yun''s computer still didn''t knock down a single line of code.


    Academician Zhan Yongshu, who was watching backstage, sighed softly, with a look of disappointment in his eyes.


    It''s obvious that the No. 101 player has fallen into a corner. If we can''t change the strategy immediately and change the topic, his progress will be far behind other players!


    At least they have seen three seeded players who have advanced the progress of the other three questions to a quarter.


    "Although the courage is commendable, it will not come to fruition if it goes on like this," Professor Zhang cunhao said with a smile. "I have just seen a circle, and it seems that he is still studying the fourth problem."


    "This kind of topic is very problematic in the competition," academician Zhan Yongshu shook his head. "The next competition can''t be so reckless."


    Professor Zhang cunhao embarrassed smile, light cough voice: "next time certainly."


    However, when both of them thought that there was no hope for player 101, Hao Yun, who was sitting at the computer desk, suddenly moved.


    It''s just that his operation seems strange?


    I saw that he was not in a hurry to write any code, but put Q in math. C file_ The code of the sqrt function is deleted directly.


    "What does he want to do?"


    Looking at the operation on Hao Yun''s screen, Zhang cunhao was surprised by the player''s enigmatic action.


    He can probably guess what the player is going to do, but he wants to redefine the algorithm of "inverse square reciprocal". However, is it possible that there is an algorithm simpler than Newton iteration in the world?


    So this is not the category of program, but the field of mathematics, right?


    President Zhan Yongshu was also surprised. For a moment, he didn''t understand what Hao Yun was going to do. Only when he saw a line [i = 0x5f375a86 - (I "1)] appear on the screen did he slightly contract his pupils.


    "I may know what he wants to do."


    “……?”


    Zhang cunhao looked at his teacher and tried to find out.


    However, academician Zhan Yongshu had no plan to answer his confusion. He just felt the scum on his chin, looked at the code on the screen, and nodded his approval.


    "Wonderful..."


    "It''s wonderful!"
『Add To Library for easy reading』
Popular recommendations
A Ruthless Proposition Wired (Buchanan-Renard #13) Mine Till Midnight (The Hathaways #1) The Wandering Calamity Married By Morning (The Hathaways #4) A Kingdom of Dreams (Westmoreland Saga #1)