An Expert Is actually By My Side

Chapter 99: Contestant number one hundred and one has gone far

   To be honest, this question really stumped Hao Yun.

   After looking at the question for a long time, he was stunned that he didn't type a line of code.

   Optimize the code for "Glacier Engine"?

   Improve engine efficiency by 10%?

   He hasn’t seen what the underlying code of this engine looks like...

   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 No. 101.

   Looking at the fourth question that appeared on the screen, Professor Zhang Cunhao, who was standing next to Academician Zhan, shook his head with a smile, and said in a rather regretful tone but not surprisingly.

   "Unexpectedly, he actually chose the fourth question, it seems completely useless."

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

   "Teacher, you shouldn't forget that before I returned to teach at Shuimu University, I worked in the front-line position of the software R&D department of Longwei Group, right?" Professor Zhang Cunhao said jokingly.

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

"That's not true. This product itself was developed by an acquired R&D team, but our software R&D department has optimized this product. The current Glacier 3.0 is the product after our second optimization. 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.

   However, he does have the proud capital.

  Longwei Group is a giant in the electronic industry of Xiaguo, and its huge software R&D team is one of the factors that lays this foundation. Even if video games are new things that only appeared after the new calendar, no software engineer despised it because of it.

   Professor Zhang Cunhao's meaning is very clear.

  Compared with the other three questions that do not limit the acceptance criteria of results, this question that has clear requirements for performance improvement is absolutely impossible to complete!

   Because this is the culmination of countless software engineers!

   Because this is the product of countless optimizations!

   Because this is the most concise code!

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

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

   Of course, it is still possible to do it in a longer time.

   "To be honest, this kind of problem that even you feel helpless, appears in this kind of competition for college students... Is it a little inappropriate?" Academician Zhan Yongshu glanced at Professor Zhang Cunhao and said.

Professor Zhang Cunhao smiled and said: “Isn’t it customary to set up a trap question among the four questions in the previous competition? This is also the seriousness of the contestants on their own objective situation. I believe that you can think of this kind of commercial application with a little brain There is little opportunity for optimization of mature software."

   Academician Zhan Yongshu chuckled and said nothing.

   He can probably guess a little bit, using this kind of question as the reason for the trap question.

   One of nature is that, as Professor Zhang Cunhao said, one of the four questions is used to bury a person and send a proposition is the practice of the Hope Cup competition. As for the second, I'm afraid it is also related to the sponsorship fees 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 topic. This is an incredible stunt in itself.

   Use this stunt for promotion, which is more topical than any hard-broadcast.

   I thought that the whole test system of this game was sponsored by Longwei Group free of charge to the organizer. Academician Zhan Yongshu didn't say anything, but didn't report much hope for the player on the screen.

   After all, even if he comes by himself, he may not be able to increase the performance of this Glacier 3.0 engine by 10% in three days. From another perspective, if there is such an easy way to do it, the Glacier Engine development team and the software engineers responsible for engine optimization must have already thought of it.

  Choosing the topic research that oneself is good at, avoiding those topics that are obviously only a waste of time and energy, is also a necessary quality for a programmer.

   If this is not possible...

   Contestant No. 101 has gone far in this game!

  ……

   Hao Yun didn't know that he was just reading the questions for such a time. The several industry leaders standing in the backstage of the examination room not far away had even foreseen his ending.

   really ends here?

   Hao Yun thought so pessimistically at the beginning.

   After all, after he quickly ran through the entire Glacier Engine code, it took a lot of effort just to understand it.

   "First, calm down..."

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

   Making graphics data output faster and higher quality is an important criterion for a good engine. Before putting this engine online, the developers of Glacier Engine had already racked their brains to optimize its code.

   It is not completely impossible to make further progress in the efforts of the predecessors, but if I hope to do it in just three days with the strength of one person, I am afraid that my system plug-in needs to be strengthened.

so……

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

   My only hope is probably only outside the code of the engine itself.

   For example, those low-level functions that are frequently called?

Whether it is a 3D engine or a 2D engine, whether it is the popular "glacier" in China or the more popular "wasteland" abroad, all game engines need to call the underlying functions frequently, and the lower the function is, the more frequently it is called. .

   Especially the 3D graphics rendering!

  Sometimes the player encounters a big scene and has a freeze, even the character hangs in the air or walks through the wall. In fact, the reason to a large extent is that the speed of the graphics algorithm cannot keep up.

  If the underlying function can be optimized...

   Maybe I really hope to solve this problem?

   For an instant, Hao Yun was taken aback by his crazy thoughts.

   Fuck?

   He carefully summed up in his mind, this seems to be more difficult than optimizing the glacier engine!

   After all, the glacier engine is still a product after the first year of the new era, but the low-level functions called by the glacier engine have been developed before the Renlian era.

but……

   What if it works?

   Swallowing, Hao Yun, with the idea of ​​giving it a try, found the math.c file in the code folder under the Glacier Engine directory, and opened a large number of called functions stored in it.

   It is obviously unrealistic to read these codes from beginning to end, but Hao Yun didn't intend to do such a stupid thing either.

   He only needs to find the engine that is called the most times during runtime, and it will be called almost every time the game scene is loaded, and the function that is sufficient to affect the efficiency of the engine, and then go there to find opportunities for improvement.

   Soon, Hao Yun locked a function named Q_Sqrt.

   This function looks unremarkable on the surface, but is just an algorithm that uses Newton's iteration method to find the reciprocal of the square root.

   What is interesting, however, is that during the operation of this engine, there are so many cases in which the reciprocal of the square root is required to be outrageous.

   So think about it from another angle, the calculation 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, etc., but when the rocket engine design and fuel technology All of them have reached a bottleneck. If you want to further improve the efficiency of the rocket, you can only start research from the basic materials.

   What Hao Yun is doing right now is a similar thing.

   However...

   Although the idea has been found, it is not easy to follow this path.

   So far, there is nothing worth digging deeper. After all, Newton's iteration method is already a very good mathematical method for finding the reciprocal of the square root.

   Want to innovate again?

   Improvement in mathematical methods is almost impossible!

  If you want to be faster than this, I am afraid that it can only be achieved by building a huge database of input values ​​and output values.

   However, building a library for a mere function seems to be turning the cart before the horse...

   Time passed by, and Hao Yun still didn't type a line of code on his computer.

   Academician Zhan Yongshu, who was watching in the background, sighed slightly, and a disappointed expression appeared in his eyes.

   Obviously, the No. 101 player has fallen into a **** situation. If he can't immediately change his strategy and change a topic, his progress will be far behind other players!

   At least they saw that there are already three seeded players, each of which has advanced the progress of the other three questions to a quarter.

  "Although the courage is commendable, there will be no results if you continue like this~www.ltnovel.com~Professor Zhang Cunhao smiled and said, "I just watched it around, as if he was still working on the fourth question. "

   "This kind of problem is very problematic when it appears in the competition," Academician Zhan Yongshu shook his head, "You can't be so foolish in the next competition."

   Professor Zhang Cunhao smiled awkwardly, and coughed slightly: "It will be next time."

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

   It's just that his operation seems a little weird?

   I saw that he was not in a hurry to write any code, but directly deleted the section of code about the Q_Sqrt function in the math.c file.

   "What does he want to do?"

   Looking at the operations on Hao Yun's screen, Zhang Cunhao was surprised by the player's mysterious movements.

   He can probably guess what the player intends to do. It is nothing more than redefining the "inverse square reciprocal" algorithm. However, is it possible that there is an algorithm in this world that is easier than Newton's iteration?

   Say that this is no longer the category of programs, but the domain of mathematics, right?

   Dean Zhan Yongshu was also surprised, and he didn't understand what Hao Yun planned to do for a while. He didn't shrink his pupils until he saw a line [i=0x5f375a86-(i》1)] appear on the screen.

   "I may know what he wants to do."

   "......?"

   Zhang Cunhao had a look of bewilderment, looked at his teacher, trying to find the answer.

   However, Academician Zhan Yongshu did not intend to answer his confusion at all. He just touched the stubborn chin on his chin, looked at the code on the screen and nodded approvingly.

   "Wonderful......"

   "It's really wonderful!"

Tap the screen to use advanced tools Tip: You can use left and right keyboard keys to browse between chapters.

You'll Also Like