Warning: session_start(): open(/opt/alt/php85/var/lib/php/session/sess_09c4c86af5e215ec27b5d7105f94eada, O_RDWR) failed: Disk quota exceeded (122) in /home/u377687657/domains/novelfull.in/public_html/db.php on line 31

Warning: session_start(): Failed to read session data: files (path: /opt/alt/php85/var/lib/php/session) in /home/u377687657/domains/novelfull.in/public_html/db.php on line 31

Warning: session_start(): open(/opt/alt/php85/var/lib/php/session/sess_09c4c86af5e215ec27b5d7105f94eada, O_RDWR) failed: Disk quota exceeded (122) in /home/u377687657/domains/novelfull.in/public_html/header.php on line 3

Warning: session_start(): Failed to read session data: files (path: /opt/alt/php85/var/lib/php/session) in /home/u377687657/domains/novelfull.in/public_html/header.php on line 3
This Top Student's Vast Amount of Knowledge Chapter 108 - 108: Chapter 108 Mini Programs | NovelFull
Reading Settings
Font Size
16px
Line Spacing
1.6
Reading Width
900px
Font Share
Theme
Text To Speech

108: Chapter 108 Mini Programs Grab a Foothold in Large Data Centers

Leaving Jiangda University, Jiang Lin did not go straight home, but as usual, took a detour to his small garage.

It had already been simply converted by him into a workstation undisturbed by the outside world.

Just as he bent down to pull open the clattering metal rolling shutter, the phone in his pocket emitted a short vibration.

Jiang Lin took out his phone. The screen showed a new email from the technical director of the quantitative trading platform, Shen Chengye.

Ever since the underlying audit report issued by Jiang Lin last time sharply pierced the hidden dangers of the platform's Baseline in the mixed usage of statistical quantities, that well-funded quantitative platform and him had reached a cooperative model in a subtle yet efficient form of core framework agreement + discrete individual task orders.

The ownership of the general-purpose code analysis toolchain in Jiang Lin's hands belonged to himself, while the quantitative platform paid for the optimization results he delivered.

Jiang Lin clicked open the email.

The task order attachment sent this time was heavier than any previous order.

The attachment package was split into three layers.

The first layer was the task order relayed by the platform.

The second layer was the desensitized performance summary from the private equity party, including flame graphs, call stacks, hardware counter statistics, and operator-level latency distribution.

The third layer was a description of the remote sandbox that would only be opened after signing.

Shen Chengye specifically marked a line in the email: "Production source code is not provided, true strategy parameters are not provided, and undesensitized trading signals are not provided. Number 1453 can only see fixed interfaces, synthetic playback data, and reproducible performance bottlenecks."

"[1453: Recently, we came into contact with a top-tier private equity institution specializing in medium-to-high frequency trading. Their core factor matrix and backtesting pipeline have been dragged down by the constantly expanding tick data, number of factors, window parameters, and historical debt."

"Every night after the market closes, thousands of stocks, futures contracts, and derivative targets must be repeatedly played back across hundreds of factors, dozen groups of window parameters, and years of minute-level data. What truly crushes the system is not the asset targets themselves, but the expanded target-factor-window combinations, the quantity of which can easily pile up to hundreds of thousands."

"In order to get results before the market opens the next day, they can only keep stacking machines, and now a whole server room has been packed full, with hardware and electricity costs pressing down on them so hard they can barely breathe."

"Their internal technical team investigated for half a month and really couldn't find a breakthrough point, so they want to invite you to do an in-depth performance audit to see where the bottleneck of this computing-power-devouring monster is stuck: business logic, data layout, cache access, or those few small operators at the very bottom that were called until they became burning hot.]"

The next paragraph of the email directly cut to the core of interests.

"[Regarding the quotation, we will talk according to the old rules: As long as you take the order, a basic hardship fee of 200,000 for the performance audit will be directly wired. If you can find the problem and also provide an actionable optimization scheme in their business environment, the subsequent remuneration will be settled in gradients according to the time consumption proportion you actually help them shave off, with no upper limit.]"

A basic fee of 200,000, plus tiered commission based on performance optimization.

This was a figure sufficient to make any independent developer green with envy.

Jiang Lin, however, was not in a hurry to reply to this temptation-filled email.

He pulled over a chair and sat down, clicking on the desensitized Profiler performance flame graph in the email attachment.

The flame graph was not the original production environment graph.

Real factor names were replaced with numbers like factor_A17 and factor_B04, target codes were completely erased, and trading signals and return curves were not in the package either.

The other party only retained the call stack shape, function time-consumption ratio, hardware model, compilation parameters, and several operator shells with fixed interfaces.

This was already enough for Jiang Lin.

He didn't need to know how this private equity firm made money, only where that machine burned its time.

Jiang Lin's gaze swept downward layer by layer, line by line, along those broad business functions at the top of the chart.

From those flashy financial calculation logics, he probed all the way down to the bottom layer.

When his gaze finally landed on the dark red, wide color patch at the very bottom representing the highest CPU utilization, he froze for a moment.

That dark red area, which occupied more than sixty percent of the entire calculation cycle, was stacked on top of a few underlying functions with unpretentious names that would even be glossed over in basic algorithm classes.

rolling_median7

rolling_rank

topk_window

Among them, rolling_rank was not a full-market cross-sectional sort, but a local ranking within a fixed small window.

The true large cross-sectional rank still remained in the subsequent audit list and could not be swallowed in one gulp by this small-window network.

Jiang Lin stared at these most ordinary function names for a full half minute.

Then, in this slightly dim old garage, he almost couldn't help laughing out loud.

Rolling median.

Rolling rank.

Top-k extreme values within the window.

For a quantitative private equity firm operating hundreds of billions of funds, every day they needed to spread out all slice data at the minute-level or even Tick-level of tens of thousands of stocks and futures contracts over the past several years of time span.

Then, the system had to act like an indefatigable mechanical gear, calculating one by one across these astronomical data sequences what the median within the past seven time slices was, what rank the target held in the current sliding window, which slices had the largest trading volume during this time period...

This was a window operator that was logically simple beyond simplicity, whose basic logic could be written in just a few lines of code even by a college freshman.

However, in the face of grand financial data streams, these tiny operators would be called up to the 10¹¹ or even 10¹² level in a single night.

Looking at this expensive flame graph, what emerged in Jiang Lin's mind was that test data sheet in Chen Qiming's office at the School of Computer Science a few hours ago, which was similarly bleeding performance.

median7_fast and top3_window in Chen Qiming's form were fundamentally the same thing in Physics meaning and mathematical essence as the private equity server room bottleneck worth millions in optimization at this moment.

On one side were scholars trapped in the ivory tower, inside offline test machines of university laboratories, arguing endlessly over a few micro-kernel instructions.

On the other side, in the prime-real-estate financial core district, inside the buzzing massive server rooms of private equity institutions, clusters of servers emitted unbearable groans due to exhausted computing power.

These two worlds, separated by a hundred thousand miles in the realistic dimension and seemingly having no intersection at all, were unexpectedly gripped tightly by the throat of fate by the exact same type of insignificant small program at the deepest computational foundation.

Jiang Lin recalled that old factor library blindly called seventy-eight million times, and recalled that crazy conception of letting a program search for programs.

At that time, this path leading to ultimate optimization was still just a crack of a door glowing with a faint light in his field of vision.

Starting from those seventy-eight million small sorts in the old factor library, to the MPS state enumeration and dead-end pruning repeatedly polished during the Jiangs Brick verification process, to today's three-layer re-targetable super-optimization framework in Chen Qiming's office...

This crack in the door was being propped open inch by inch by him with irrefutable engineering strength, until it became a broad and smooth highway.

He placed his hands on the keyboard and replied to Shen Chengye with a short and powerful email.

"[I accept the task, and the 200,000 basic audit fee will go through the process as you said.]"

"[However, before starting work, three points must be written into the agreement.]"

"[First, I only touch the desensitized performance audit package and the remote sandbox, and will not touch real strategies, trading signals, customer positions, or capital parameters.]"

"[Second, the other party must write the processing rules for missing values, suspension sentinels, NaNs, tie-breaking, and rehabilitation exceptions into interface documents.]"

"[Third, the toolchain I use to optimize underlying operators belongs to me personally and will not transfer with the project delivery.]"

At the end of the email, after a brief thought, he added a pragmatic statement.

"[In addition, given the complexity of this micro-architecture optimization, the current performance optimization can only provide them with a baseline solution first. For industrial-grade applications of their magnitude, the truly huge performance dividends must be mined with deeper-dimensional algorithm searches; that tool is currently still under development by me. As for how much time-consumption this first version of the baseline solution can help them squeeze out, I will report it to you after I hook it onto their hardware environment for actual measurement and get the results.]"

Less than three minutes after the send button was pressed.

Shen Chengye gave a positive reply.

Over the next few days, Jiang Lin's rhythm of life, like the precisely divided clock cycles inside a processor, was accurately split into two distinct halves.

Under the sunlight of the day, using the increasingly mature MPS toolchain, he first thoroughly probed the bottom of that private equity institution's complex and chaotic feature calculation pipeline.

Next, he modified the cost backend of the three-layer re-targetable framework originally demonstrated in Chen Qiming's office, and hooked it onto the perf performance model of the specific micro-architecture used by the private equity institution's server cluster.

With the help of powerful computing power deduction, he ran a version of optimized code used as a baseline.

That rolling_median7 code, which originally adopted traditional sorting algorithms and suffered heavy losses in branch prediction, was ruthlessly uprooted.

Replaced it was a brand-new implementation rigorously proven to be absolutely correct by the Zero-One Principle, and particularly suited to the hardware pipeline temperament of that private equity institution at the instruction level.

If taken alone to look at the microscopic time consumption of a single function call, this new code was still only a few nanoseconds faster than the original version, seemingly negligible.

However, when this tiny optimization was multiplied by a terrifying call base of up to trillions of times within a single night, quantitative change finally triggered qualitative change.

A few days later, inspiring news from actual measurements came back from the private equity institution.

The total time consumption of the entire feature backtesting pipeline was forcibly squeezed down by a huge margin.

Tasks that previously had to run until six o'clock in the morning of the next day to barely produce results were all finished running by three-thirty in the morning.

median7 was not the only function replaced.

Jiang Lin replaced a total of three hot paths.

rolling_median7, the fixed-window topk_window, and a small sort in the local rank that repeatedly constructed temporary arrays.

The gains of a single call were only at the nanosecond level, but the three places combined ate up close to sixty percent of the CPU time of the original pipeline.

In the server room, a batch of servers that were originally squeezed dry by high temperatures and full loads extinguished their high-load indicator lights ahead of schedule that very night, quietly becoming idle.

Prev Next

🔊 Text To Speech

Listen while reading

Ready

Warning: session_start(): Session cannot be started after headers have already been sent (sent from /home/u377687657/domains/novelfull.in/public_html/header.php on line 80) in /home/u377687657/domains/novelfull.in/public_html/footer.php on line 3