Chapter Ninety-Nine: Player No. 101 has gone away

To be honest, this question really stumped Hao Yun.

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

Optimized for "Glacier Engine" code?

10% more efficient engine?

Anyway, he hasn't even seen what the underlying code of this engine looks like......

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

At the request of Academician Zhan Yongshu, the staff called up the screen of player 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 but unsurprising tone.

"I didn't expect him to choose the fourth question, it seems that it is completely out of play."

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

"Teacher, should you forget that before I taught at Huishuimu University, I worked in the front-line position of the software research and development department of Longwei Group, right?" Professor Zhang Cunhao said jokingly.

"I haven't read the specifics of the title, is this glacier engine also a product of your department?"

"That's not it, the product itself was developed by an acquired R&D team, but our software R&D department has optimized this product, and the current Glacier 3.0 is the product after our second optimization. Nowadays, the mainstream large-scale 3D action games, especially in the third-person category, are basically made with this engine! Professor Zhang Cunhao said, and his face couldn't help but hang a touch of pride.

However, he does have the capital to be proud of.

Longwei Group is a giant in the field of electronic industry in Xiaguo, and its huge software research and development team is one of the factors that lay this foundation. Even though video games are a new novelty, no software engineer takes them lightly.

Professor Zhang Cunhao's meaning is very clear.

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

Because it's the brainchild of countless software engineers!

Because that's what happens after countless optimizations!

Because that's the most concise code!

It's like a work of art, and not a single letter is superfluous!

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

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

"Truth be told, this kind of question, which even you feel like you can't handle, appears in this kind of competition for college students...... Isn't that inappropriate? Academician Zhan Yongshu glanced at Professor Zhang Cunhao and said.

Professor Zhang Cunhao smiled and said: "Isn't it customary to set a trap question among the four questions in the previous competition? This is also to examine the seriousness of the contestants in their own objective situation. I believe that with a little bit of brain, there is little chance of optimizing this kind of software that has already matured for commercial applications. ”

Academician Zhan Yongshu smiled and did not speak.

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

One of them is naturally that, as Professor Zhang Cunhao said, it is the practice of the Hope Cup Competition to stuff one of the four questions to bury people. As for the second, I am afraid it is also related to the fact that Longwei Group has given a lot of sponsorship fees.

After all, for a national event 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.

Using this gimmick to promote is more topical than any hard broad.

Thinking that the entire examination system of this competition was sponsored by Longwei Group for free to the organizer, Academician Zhan Yongshu didn't say anything, but he didn't have much hope for the player on the screen.

After all, even if he came by himself, he might not be able to improve the performance of this Glacier 3.0 engine by 10% in three days. On the other hand, if there was such an easy way to do it, the development team of Glacier Engine and the software engineers responsible for optimizing the engine must have thought of it a long time ago.

Choosing a topic that you are good at and avoiding topics that obviously only waste time and energy is also a must-have quality for a programmer.

If you can't do that......

In this game, player No. 101 has gone far!

……

Hao Yun didn't know that he was just reading the questions, and several industry bigwigs standing in the backstage of the examination room not far away had even foreseen his ending.

Is this really the end of it?

At first, Hao Yun also thought so pessimistically.

After all, when he quickly went through the code of the entire glacier engine, it took a lot of effort just to understand it.

"First of all, you have to calm down......"

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

Making graphics data faster and higher quality is an important criterion for a good engine. Presumably, the developers of Glacier Engine had already racked their brains to optimize the code before the engine was launched.

It is not completely impossible to go further on the efforts of predecessors, but if you expect to do it in just three days with the strength of one person, I am afraid that your system plug-in will have to be strengthened.

In this way......

It's almost impossible to optimize the code of the engine itself.

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

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

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

Especially the 3D graphics rendering!

Sometimes players encounter lag in large scenes, and even characters hang in the air and pass through walls, in fact, a large part of the reason is that the speed of the graphics algorithm cannot keep up.

If you can optimize the underlying functions......

Do you really have any hope of solving this problem?

For a moment, Hao Yun was taken aback by his crazy thoughts.

it?

He carefully calculated 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 calendar, but the underlying functions called by the glacier engine have been developed before the era of the human union.

But......

What if it works?

Swallowing his saliva, Hao Yun found the math.c file in the code folder in the glacier engine directory with the idea of giving it a try, and opened the large number of called functions stored in it.

It was obviously unrealistic to read all of this code from beginning to end, but Hao Yun didn't intend to do such a stupid thing.

All he had to do was find the functions that were called the most frequently at runtime, almost every time the game scene was loaded, and that were enough to affect the engine's efficiency, and then look for opportunities to improve it.

Soon, Hao Yun locked on to a function named Q_Sqrt.

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

Interestingly, however, the number of reciprocal cases required to reciprocate the square root during the operation of this engine was outrageous.

Therefore, from another point of view, the 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 design and fuel technology of the rocket engine have developed to a bottleneck, if you want to further improve the efficiency of the rocket, you can only start from the fundamental materials.

What Hao Yun is doing at this moment is something similar.

However......

Although the idea has been found, it is not easy to get through.

So far, there is nothing worth digging into, after all, Newton's iterative method is already a very good mathematical method for finding the reciprocal square root.

Want to innovate again?

Mathematically improving is almost impossible!

If you want to go faster than that, you'll have to build a huge database of input and output values.

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

Time passed minute by minute, and there was still not a single line of code typed on Hao Yun's computer.

Academician Zhan Yongshu, who was watching in the background, sighed softly, and a look of disappointment appeared in his eyes.

Obviously, the No. 101 player has fallen into a situation where he is on the tip of the bull's horns. If he can't change his strategy immediately and change the question, his progress will be far behind by the other players!

At least they saw three seeded players, each of whom had advanced their progress to a quarter of the other three questions.

"Although the courage is commendable, there will be no results if it goes on like this," Professor Zhang Cunhao said with a smile, "I just looked around, and it seems that he is still working on the fourth question." ”

"This kind of question is very problematic when it appears in the competition," Academician Zhan Yongshu shook his head, "The next competition can't be so nonsense." ”

Professor Zhang Cunhao smiled awkwardly and coughed lightly: "Next time, definitely." ”

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

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

I saw that he didn't rush to write any code, but deleted the code about the Q_Sqrt function in the math.c file.

"What does he want to do?"

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

He could probably guess what the player was going to do, which was nothing more than trying to redefine the "inverse square reciprocal" algorithm, but is it possible that there is an algorithm in the world that is simpler than Newton's iteration?

In other words, this is no longer the domain of program, but the field of mathematics, right?

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

"I probably know what he's trying to do."

“……?”

Zhang Cunhao looked confused, looked at his teacher, and tried to seek an answer.

However, Academician Zhan Yongshu had no intention of answering his confusion at all, just touching the stubble on his chin there, looking at the code on the screen and nodding approvingly.

"Wonderful......"

"It's wonderful!"