Isn't the code all written by hand? 1,000 lines is easy to reach. Before the Spring Festival in 2007-2008, our customers asked us if we could make a search engine for them. I had never learned search, but I had read some popular science articles and studied some ideas myself. I knew Lucene in advance and knew it was based on Java. I went out and bought an introductory book on Lucene in Action and Java language, and then went home for the Spring Festival. During the 7-day Spring Festival holiday, my girlfriend and parents were playing cards and watching TV, and I was in another room, reading these two books and writing a search system based on Lucene. I designed an XML input and output protocol, and the index import format used XML. I wrote a Java version of the web server as the bottom layer of the system. The query returns the XML result in REST format. A configuration file is used in a configuration directory to set the query field, sorting field, and built-in index sorting. To switch different query methods, you only need to select a different configuration file name in the URL, with simple logs. In 7 days, we wrote 2,000-3,000 lines of code. After the holiday, we put it online for testing for our customers. Once it was enabled, their search speed dropped from several minutes without results at peak times to a stable speed of tens of milliseconds. Their daily search volume increased from 4,000 to 8,000, and later to 100,000. After they had 200,000 to 300,000 searches, the code was improved for the first time, and the performance was improved to ***. Later, we connected more customers, and the code was continuously improved, and the *** single machine supported 20 million searches. After several improvements, the code increased to more than 18,000. Later, I stopped paying attention to the number of lines. The system developed from this code has served Fantong.com, Dianping.com, FTChinese, Liujianfang.com, Shanda Bookstore, and dozens of small customers of our company at that time. The daily search volume is about 30 million, and at least hundreds of millions of searches should have been completed. (I have written hundreds of amateur side projects in my career, most of which have not been released, and most of which have more than 3,000 lines.) Since someone has liked this post, let me tell you another story. Shanghai Taini has not closed down yet because of a typesetting system. We support the format of Apple iBook Author from the bottom up. This is a very complex packaging format, similar to a web page, but it has a lot of typesetting formats and CSS3 standard things that are not supported by web pages. In 2012, when our company was about to run out of money, I suddenly had a crazy idea to make this very complicated thing. But when I told this idea to our chief programmer, who is now the CTO teacher @陈勇辉, this idiot didn't understand. So, during the three days I was on a business trip to give a speech, I wrote a prototype, implemented an XML DOM parsing tree, a simple CSS parsing tree, and wrote a simple iBook Author format analysis document. Using the file format I analyzed, I wrote a demo that can display the information of a page of an iBook Author e-book. I just checked the code base, and it’s less than 900 lines. I gave it to the main programmer and explained the ideas and file format details to him. Then the next day, he understood it, and I didn't participate in the specific code of this project. This project now has about 26,000 lines. It has earned the company about 2 million. The company survived because of this project. |
<<: Google: 10 rules you must know to build a great mobile app
The chicks of the Grey-headed Lapwing are precoci...
Will the moon fall? If someone asks this question...
On April 19, 2021, the 19th Shanghai Internationa...
A new study shows that fire has prompted plants t...
The author of this article conducted a market ana...
After more than a month of waiting, the launch co...
Industry dynamics overview The market size has a ...
On June 13, the quadrennial World Cup will kick o...
Today I will mainly talk about the topic of event...
At the end of August, ofo announced the launch of...
Xiaohongshu has become another marketing platform...
In the era of social dividends, the reason why th...
Produced by: Science Popularization China Author:...
In Journey to the West, in order to force Princes...
Learn character design with Hollywood animation m...